@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.
- package/README.md +179 -0
- package/android/build.gradle +64 -0
- package/android/consumer-rules.pro +3 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/java/com/whop/elements/WhopAddressSuggestionsModule.kt +102 -0
- package/android/src/main/java/com/whop/elements/WhopAuthSessionModule.kt +126 -0
- package/android/src/main/java/com/whop/elements/WhopElementsPackage.kt +39 -0
- package/android/src/main/java/com/whop/elements/WhopPayButtonManager.kt +74 -0
- package/android/src/main/java/com/whop/elements/WhopPayButtonPressEvent.kt +17 -0
- package/android/src/main/java/com/whop/elements/WhopPayButtonView.kt +178 -0
- package/android/src/main/java/com/whop/elements/WhopPlatformPayModule.kt +212 -0
- package/assets/whop-wordmark-dark.png +0 -0
- package/assets/whop-wordmark-dark@2x.png +0 -0
- package/assets/whop-wordmark-dark@3x.png +0 -0
- package/assets/whop-wordmark-light.png +0 -0
- package/assets/whop-wordmark-light@2x.png +0 -0
- package/assets/whop-wordmark-light@3x.png +0 -0
- package/ios/Package.swift +59 -0
- package/ios/Sources/ElementsReactNative/WhopAddressSuggestionsImpl.swift +189 -0
- package/ios/Sources/ElementsReactNative/WhopAuthSessionImpl.swift +106 -0
- package/ios/Sources/ElementsReactNative/WhopPayButtonImpl.swift +89 -0
- package/ios/Sources/ElementsReactNative/WhopPlatformPayImpl.swift +181 -0
- package/ios/generated/WhopAddressSuggestionsModule.h +11 -0
- package/ios/generated/WhopAddressSuggestionsModule.mm +46 -0
- package/ios/generated/WhopAuthSessionModule.h +11 -0
- package/ios/generated/WhopAuthSessionModule.mm +45 -0
- package/ios/generated/WhopElementsShims.h +35 -0
- package/ios/generated/WhopPayButtonComponentView.h +12 -0
- package/ios/generated/WhopPayButtonComponentView.mm +82 -0
- package/ios/generated/WhopPlatformPayModule.h +11 -0
- package/ios/generated/WhopPlatformPayModule.mm +51 -0
- package/lib/module/api/client.js +139 -0
- package/lib/module/api/client.js.map +1 -0
- package/lib/module/api/client.test.js +137 -0
- package/lib/module/api/client.test.js.map +1 -0
- package/lib/module/api/types.js +2 -0
- package/lib/module/api/types.js.map +1 -0
- package/lib/module/controller/actions.js +148 -0
- package/lib/module/controller/actions.js.map +1 -0
- package/lib/module/controller/actions.test.js +102 -0
- package/lib/module/controller/actions.test.js.map +1 -0
- package/lib/module/controller/store.js +158 -0
- package/lib/module/controller/store.js.map +1 -0
- package/lib/module/core/address/country-data.js +1370 -0
- package/lib/module/core/address/country-data.js.map +1 -0
- package/lib/module/core/address/country-name.js +38 -0
- package/lib/module/core/address/country-name.js.map +1 -0
- package/lib/module/core/address/country-names.generated.js +249 -0
- package/lib/module/core/address/country-names.generated.js.map +1 -0
- package/lib/module/core/address/engine.js +245 -0
- package/lib/module/core/address/engine.js.map +1 -0
- package/lib/module/core/address/engine.test.js +216 -0
- package/lib/module/core/address/engine.test.js.map +1 -0
- package/lib/module/core/address/form-state.js +409 -0
- package/lib/module/core/address/form-state.js.map +1 -0
- package/lib/module/core/address/form-state.test.js +516 -0
- package/lib/module/core/address/form-state.test.js.map +1 -0
- package/lib/module/core/address/places.js +36 -0
- package/lib/module/core/address/places.js.map +1 -0
- package/lib/module/core/address/required-coverage.test.js +57 -0
- package/lib/module/core/address/required-coverage.test.js.map +1 -0
- package/lib/module/core/address/suggest.js +102 -0
- package/lib/module/core/address/suggest.js.map +1 -0
- package/lib/module/core/address/suggest.test.js +156 -0
- package/lib/module/core/address/suggest.test.js.map +1 -0
- package/lib/module/core/address/use-suggestions.js +33 -0
- package/lib/module/core/address/use-suggestions.js.map +1 -0
- package/lib/module/core/payments/address-change.js +91 -0
- package/lib/module/core/payments/address-change.js.map +1 -0
- package/lib/module/core/payments/billing-merge.js +62 -0
- package/lib/module/core/payments/billing-merge.js.map +1 -0
- package/lib/module/core/payments/browser-info.js +42 -0
- package/lib/module/core/payments/browser-info.js.map +1 -0
- package/lib/module/core/payments/bt.js +151 -0
- package/lib/module/core/payments/bt.js.map +1 -0
- package/lib/module/core/payments/bt.test.js +23 -0
- package/lib/module/core/payments/bt.test.js.map +1 -0
- package/lib/module/core/payments/currency.js +37 -0
- package/lib/module/core/payments/currency.js.map +1 -0
- package/lib/module/core/payments/detail.js +159 -0
- package/lib/module/core/payments/detail.js.map +1 -0
- package/lib/module/core/payments/detail.test.js +225 -0
- package/lib/module/core/payments/detail.test.js.map +1 -0
- package/lib/module/core/payments/errors.js +115 -0
- package/lib/module/core/payments/errors.js.map +1 -0
- package/lib/module/core/payments/mint.js +89 -0
- package/lib/module/core/payments/mint.js.map +1 -0
- package/lib/module/core/payments/plan.js +131 -0
- package/lib/module/core/payments/plan.js.map +1 -0
- package/lib/module/core/payments/refusals.js +17 -0
- package/lib/module/core/payments/refusals.js.map +1 -0
- package/lib/module/core/payments/secure-fields.js +87 -0
- package/lib/module/core/payments/secure-fields.js.map +1 -0
- package/lib/module/core/payments/tax-id-catalog.js +616 -0
- package/lib/module/core/payments/tax-id-catalog.js.map +1 -0
- package/lib/module/core/payments/wallet-contact.js +42 -0
- package/lib/module/core/payments/wallet-contact.js.map +1 -0
- package/lib/module/core/payments/wallet-contact.test.js +77 -0
- package/lib/module/core/payments/wallet-contact.test.js.map +1 -0
- package/lib/module/elements/address.js +467 -0
- package/lib/module/elements/address.js.map +1 -0
- package/lib/module/elements/branding.js +114 -0
- package/lib/module/elements/branding.js.map +1 -0
- package/lib/module/elements/card-fields/context.js +254 -0
- package/lib/module/elements/card-fields/context.js.map +1 -0
- package/lib/module/elements/card-fields/fields.js +309 -0
- package/lib/module/elements/card-fields/fields.js.map +1 -0
- package/lib/module/elements/card-fields/index.js +30 -0
- package/lib/module/elements/card-fields/index.js.map +1 -0
- package/lib/module/elements/card.js +107 -0
- package/lib/module/elements/card.js.map +1 -0
- package/lib/module/elements/email.js +84 -0
- package/lib/module/elements/email.js.map +1 -0
- package/lib/module/elements/payment/declared-fields.js +186 -0
- package/lib/module/elements/payment/declared-fields.js.map +1 -0
- package/lib/module/elements/payment/index.js +448 -0
- package/lib/module/elements/payment/index.js.map +1 -0
- package/lib/module/elements/payment/wallet.js +132 -0
- package/lib/module/elements/payment/wallet.js.map +1 -0
- package/lib/module/elements/tax-id.js +100 -0
- package/lib/module/elements/tax-id.js.map +1 -0
- package/lib/module/i18n/catalogs.js +103 -0
- package/lib/module/i18n/catalogs.js.map +1 -0
- package/lib/module/i18n/index.js +45 -0
- package/lib/module/i18n/index.js.map +1 -0
- package/lib/module/index.js +27 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/namespace.js +174 -0
- package/lib/module/namespace.js.map +1 -0
- package/lib/module/native/index.js +128 -0
- package/lib/module/native/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/provider.js +56 -0
- package/lib/module/provider.js.map +1 -0
- package/lib/module/specs/NativeWhopAddressSuggestions.js +6 -0
- package/lib/module/specs/NativeWhopAddressSuggestions.js.map +1 -0
- package/lib/module/specs/NativeWhopAuthSession.js +10 -0
- package/lib/module/specs/NativeWhopAuthSession.js.map +1 -0
- package/lib/module/specs/NativeWhopPlatformPay.js +10 -0
- package/lib/module/specs/NativeWhopPlatformPay.js.map +1 -0
- package/lib/module/specs/WhopPayButtonNativeComponent.ts +22 -0
- package/lib/module/theme/appearance.js +85 -0
- package/lib/module/theme/appearance.js.map +1 -0
- package/lib/module/theme/appearance.test.js +124 -0
- package/lib/module/theme/appearance.test.js.map +1 -0
- package/lib/module/theme/provider.js +25 -0
- package/lib/module/theme/provider.js.map +1 -0
- package/lib/module/theme/resolve.js +69 -0
- package/lib/module/theme/resolve.js.map +1 -0
- package/lib/module/theme/scales.generated.js +419 -0
- package/lib/module/theme/scales.generated.js.map +1 -0
- package/lib/module/ui/element-frame.js +83 -0
- package/lib/module/ui/element-frame.js.map +1 -0
- package/lib/module/ui/payment-method-icon.js +69 -0
- package/lib/module/ui/payment-method-icon.js.map +1 -0
- package/lib/module/ui/primitives.js +266 -0
- package/lib/module/ui/primitives.js.map +1 -0
- package/lib/module/ui/select.js +281 -0
- package/lib/module/ui/select.js.map +1 -0
- package/lib/module/ui/suggestions.js +71 -0
- package/lib/module/ui/suggestions.js.map +1 -0
- package/lib/module/ui/whop-logo.js +42 -0
- package/lib/module/ui/whop-logo.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/api/client.d.ts +87 -0
- package/lib/typescript/src/api/client.d.ts.map +1 -0
- package/lib/typescript/src/api/types.d.ts +175 -0
- package/lib/typescript/src/api/types.d.ts.map +1 -0
- package/lib/typescript/src/controller/actions.d.ts +42 -0
- package/lib/typescript/src/controller/actions.d.ts.map +1 -0
- package/lib/typescript/src/controller/store.d.ts +90 -0
- package/lib/typescript/src/controller/store.d.ts.map +1 -0
- package/lib/typescript/src/core/address/country-data.d.ts +4 -0
- package/lib/typescript/src/core/address/country-data.d.ts.map +1 -0
- package/lib/typescript/src/core/address/country-name.d.ts +2 -0
- package/lib/typescript/src/core/address/country-name.d.ts.map +1 -0
- package/lib/typescript/src/core/address/country-names.generated.d.ts +2 -0
- package/lib/typescript/src/core/address/country-names.generated.d.ts.map +1 -0
- package/lib/typescript/src/core/address/engine.d.ts +97 -0
- package/lib/typescript/src/core/address/engine.d.ts.map +1 -0
- package/lib/typescript/src/core/address/form-state.d.ts +144 -0
- package/lib/typescript/src/core/address/form-state.d.ts.map +1 -0
- package/lib/typescript/src/core/address/places.d.ts +23 -0
- package/lib/typescript/src/core/address/places.d.ts.map +1 -0
- package/lib/typescript/src/core/address/suggest.d.ts +47 -0
- package/lib/typescript/src/core/address/suggest.d.ts.map +1 -0
- package/lib/typescript/src/core/address/use-suggestions.d.ts +3 -0
- package/lib/typescript/src/core/address/use-suggestions.d.ts.map +1 -0
- package/lib/typescript/src/core/payments/address-change.d.ts +52 -0
- package/lib/typescript/src/core/payments/address-change.d.ts.map +1 -0
- package/lib/typescript/src/core/payments/billing-merge.d.ts +39 -0
- package/lib/typescript/src/core/payments/billing-merge.d.ts.map +1 -0
- package/lib/typescript/src/core/payments/browser-info.d.ts +12 -0
- package/lib/typescript/src/core/payments/browser-info.d.ts.map +1 -0
- package/lib/typescript/src/core/payments/bt.d.ts +55 -0
- package/lib/typescript/src/core/payments/bt.d.ts.map +1 -0
- package/lib/typescript/src/core/payments/currency.d.ts +7 -0
- package/lib/typescript/src/core/payments/currency.d.ts.map +1 -0
- package/lib/typescript/src/core/payments/detail.d.ts +53 -0
- package/lib/typescript/src/core/payments/detail.d.ts.map +1 -0
- package/lib/typescript/src/core/payments/errors.d.ts +62 -0
- package/lib/typescript/src/core/payments/errors.d.ts.map +1 -0
- package/lib/typescript/src/core/payments/mint.d.ts +74 -0
- package/lib/typescript/src/core/payments/mint.d.ts.map +1 -0
- package/lib/typescript/src/core/payments/plan.d.ts +69 -0
- package/lib/typescript/src/core/payments/plan.d.ts.map +1 -0
- package/lib/typescript/src/core/payments/refusals.d.ts +12 -0
- package/lib/typescript/src/core/payments/refusals.d.ts.map +1 -0
- package/lib/typescript/src/core/payments/secure-fields.d.ts +33 -0
- package/lib/typescript/src/core/payments/secure-fields.d.ts.map +1 -0
- package/lib/typescript/src/core/payments/tax-id-catalog.d.ts +481 -0
- package/lib/typescript/src/core/payments/tax-id-catalog.d.ts.map +1 -0
- package/lib/typescript/src/core/payments/wallet-contact.d.ts +40 -0
- package/lib/typescript/src/core/payments/wallet-contact.d.ts.map +1 -0
- package/lib/typescript/src/elements/address.d.ts +55 -0
- package/lib/typescript/src/elements/address.d.ts.map +1 -0
- package/lib/typescript/src/elements/branding.d.ts +18 -0
- package/lib/typescript/src/elements/branding.d.ts.map +1 -0
- package/lib/typescript/src/elements/card-fields/context.d.ts +67 -0
- package/lib/typescript/src/elements/card-fields/context.d.ts.map +1 -0
- package/lib/typescript/src/elements/card-fields/fields.d.ts +15 -0
- package/lib/typescript/src/elements/card-fields/fields.d.ts.map +1 -0
- package/lib/typescript/src/elements/card-fields/index.d.ts +21 -0
- package/lib/typescript/src/elements/card-fields/index.d.ts.map +1 -0
- package/lib/typescript/src/elements/card.d.ts +21 -0
- package/lib/typescript/src/elements/card.d.ts.map +1 -0
- package/lib/typescript/src/elements/email.d.ts +31 -0
- package/lib/typescript/src/elements/email.d.ts.map +1 -0
- package/lib/typescript/src/elements/payment/declared-fields.d.ts +43 -0
- package/lib/typescript/src/elements/payment/declared-fields.d.ts.map +1 -0
- package/lib/typescript/src/elements/payment/index.d.ts +37 -0
- package/lib/typescript/src/elements/payment/index.d.ts.map +1 -0
- package/lib/typescript/src/elements/payment/wallet.d.ts +39 -0
- package/lib/typescript/src/elements/payment/wallet.d.ts.map +1 -0
- package/lib/typescript/src/elements/tax-id.d.ts +41 -0
- package/lib/typescript/src/elements/tax-id.d.ts.map +1 -0
- package/lib/typescript/src/i18n/catalogs.d.ts +7 -0
- package/lib/typescript/src/i18n/catalogs.d.ts.map +1 -0
- package/lib/typescript/src/i18n/index.d.ts +17 -0
- package/lib/typescript/src/i18n/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +42 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/namespace.d.ts +36 -0
- package/lib/typescript/src/namespace.d.ts.map +1 -0
- package/lib/typescript/src/native/index.d.ts +62 -0
- package/lib/typescript/src/native/index.d.ts.map +1 -0
- package/lib/typescript/src/provider.d.ts +37 -0
- package/lib/typescript/src/provider.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeWhopAddressSuggestions.d.ts +13 -0
- package/lib/typescript/src/specs/NativeWhopAddressSuggestions.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeWhopAuthSession.d.ts +20 -0
- package/lib/typescript/src/specs/NativeWhopAuthSession.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeWhopPlatformPay.d.ts +24 -0
- package/lib/typescript/src/specs/NativeWhopPlatformPay.d.ts.map +1 -0
- package/lib/typescript/src/specs/WhopPayButtonNativeComponent.d.ts +21 -0
- package/lib/typescript/src/specs/WhopPayButtonNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/theme/appearance.d.ts +71 -0
- package/lib/typescript/src/theme/appearance.d.ts.map +1 -0
- package/lib/typescript/src/theme/provider.d.ts +11 -0
- package/lib/typescript/src/theme/provider.d.ts.map +1 -0
- package/lib/typescript/src/theme/resolve.d.ts +19 -0
- package/lib/typescript/src/theme/resolve.d.ts.map +1 -0
- package/lib/typescript/src/theme/scales.generated.d.ts +18 -0
- package/lib/typescript/src/theme/scales.generated.d.ts.map +1 -0
- package/lib/typescript/src/ui/element-frame.d.ts +32 -0
- package/lib/typescript/src/ui/element-frame.d.ts.map +1 -0
- package/lib/typescript/src/ui/payment-method-icon.d.ts +21 -0
- package/lib/typescript/src/ui/payment-method-icon.d.ts.map +1 -0
- package/lib/typescript/src/ui/primitives.d.ts +94 -0
- package/lib/typescript/src/ui/primitives.d.ts.map +1 -0
- package/lib/typescript/src/ui/select.d.ts +25 -0
- package/lib/typescript/src/ui/select.d.ts.map +1 -0
- package/lib/typescript/src/ui/suggestions.d.ts +15 -0
- package/lib/typescript/src/ui/suggestions.d.ts.map +1 -0
- package/lib/typescript/src/ui/whop-logo.d.ts +4 -0
- package/lib/typescript/src/ui/whop-logo.d.ts.map +1 -0
- package/package.json +121 -0
- package/scripts/check-swift.sh +27 -0
- package/scripts/codegen-shims.mjs +409 -0
- package/scripts/gen-country-names.mjs +58 -0
- package/scripts/gen-theme.mjs +124 -0
- package/scripts/gen-wordmark.mjs +68 -0
- package/scripts/mirror.mjs +112 -0
- package/src/api/client.ts +202 -0
- package/src/api/types.ts +166 -0
- package/src/controller/actions.ts +197 -0
- package/src/controller/store.ts +201 -0
- package/src/core/address/country-data.ts +927 -0
- package/src/core/address/country-name.ts +36 -0
- package/src/core/address/country-names.generated.ts +246 -0
- package/src/core/address/engine.ts +349 -0
- package/src/core/address/form-state.ts +479 -0
- package/src/core/address/places.ts +39 -0
- package/src/core/address/suggest.ts +153 -0
- package/src/core/address/use-suggestions.ts +37 -0
- package/src/core/payments/address-change.ts +121 -0
- package/src/core/payments/billing-merge.ts +91 -0
- package/src/core/payments/browser-info.ts +43 -0
- package/src/core/payments/bt.ts +176 -0
- package/src/core/payments/currency.ts +54 -0
- package/src/core/payments/detail.ts +204 -0
- package/src/core/payments/errors.ts +171 -0
- package/src/core/payments/mint.ts +130 -0
- package/src/core/payments/plan.ts +198 -0
- package/src/core/payments/refusals.ts +24 -0
- package/src/core/payments/secure-fields.ts +85 -0
- package/src/core/payments/tax-id-catalog.ts +320 -0
- package/src/core/payments/wallet-contact.ts +56 -0
- package/src/elements/address.tsx +570 -0
- package/src/elements/branding.tsx +87 -0
- package/src/elements/card-fields/context.tsx +310 -0
- package/src/elements/card-fields/fields.tsx +281 -0
- package/src/elements/card-fields/index.tsx +37 -0
- package/src/elements/card.tsx +101 -0
- package/src/elements/email.tsx +100 -0
- package/src/elements/payment/declared-fields.tsx +238 -0
- package/src/elements/payment/index.tsx +497 -0
- package/src/elements/payment/wallet.tsx +155 -0
- package/src/elements/tax-id.tsx +143 -0
- package/src/i18n/catalogs.ts +100 -0
- package/src/i18n/index.tsx +46 -0
- package/src/index.ts +68 -0
- package/src/namespace.tsx +231 -0
- package/src/native/index.ts +173 -0
- package/src/provider.tsx +76 -0
- package/src/specs/NativeWhopAddressSuggestions.ts +14 -0
- package/src/specs/NativeWhopAuthSession.ts +21 -0
- package/src/specs/NativeWhopPlatformPay.ts +25 -0
- package/src/specs/WhopPayButtonNativeComponent.ts +22 -0
- package/src/theme/appearance.ts +150 -0
- package/src/theme/provider.tsx +28 -0
- package/src/theme/resolve.ts +68 -0
- package/src/theme/scales.generated.ts +427 -0
- package/src/ui/element-frame.tsx +94 -0
- package/src/ui/payment-method-icon.tsx +55 -0
- package/src/ui/primitives.tsx +269 -0
- package/src/ui/select.tsx +255 -0
- package/src/ui/suggestions.tsx +69 -0
- package/src/ui/whop-logo.tsx +37 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../../../../src/elements/card-fields/fields.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,KAAK,SAAS,EAA0B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAetF,MAAM,WAAW,cAAc;IAC9B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,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;CAC9D;AAkGD,wBAAgB,iBAAiB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,cAAc,2CA4CtF;AAED,wBAAgB,iBAAiB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,cAAc,2CAqCtF;AAED,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,cAAc,2CAsCnF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { type CardFieldsChangePayload } from './context.js';
|
|
3
|
+
export interface CardFieldsProps {
|
|
4
|
+
/** Advanced Basis Theory publishable key. Omit it to fetch the key automatically. */
|
|
5
|
+
publicKey?: string;
|
|
6
|
+
/** `stacked` shapes composed fields as a number row above expiry and cvc. `compact` is one row.
|
|
7
|
+
* Separately mounted fields ignore this and render with full borders and rounded corners. */
|
|
8
|
+
layout?: 'stacked' | 'compact';
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
onChange?: (payload: CardFieldsChangePayload) => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Three separately mountable, PCI-isolated card fields for custom layouts. Place each field where
|
|
14
|
+
* the design wants it, enable the pay button from `onChange`, and confirm with
|
|
15
|
+
* `payments.createConfirmationToken()`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function CardFields({ publicKey, layout, children, onChange }: CardFieldsProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export { CardCvcElement, CardExpiryElement, CardNumberElement } from './fields.js';
|
|
19
|
+
export type { CardFieldProps } from './fields.js';
|
|
20
|
+
export type { CardFieldsChangePayload } from './context.js';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/elements/card-fields/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAsB,KAAK,uBAAuB,EAAqB,MAAM,cAAW,CAAC;AAEhG,MAAM,WAAW,eAAe;IAC/B,qFAAqF;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;kGAC8F;IAC9F,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC/B,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,uBAAuB,KAAK,IAAI,CAAC;CACtD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,MAAkB,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,eAAe,2CAOhG;AAQD,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAU,CAAC;AAChF,YAAY,EAAE,cAAc,EAAE,MAAM,aAAU,CAAC;AAC/C,YAAY,EAAE,uBAAuB,EAAE,MAAM,cAAW,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import { type CardFieldsChangePayload } from './card-fields/context.js';
|
|
4
|
+
export interface CardElementProps {
|
|
5
|
+
/** `stacked` places the number above expiry and cvc. `compact` places all three in one row. */
|
|
6
|
+
layout?: 'stacked' | 'compact';
|
|
7
|
+
style?: StyleProp<ViewStyle>;
|
|
8
|
+
fallback?: ReactNode;
|
|
9
|
+
onChange?: (payload: CardFieldsChangePayload) => void;
|
|
10
|
+
onReady?: () => void;
|
|
11
|
+
onError?: (error: {
|
|
12
|
+
message: string;
|
|
13
|
+
code?: string;
|
|
14
|
+
}) => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Prearranged fields for card number, expiration, and security code. Card numbers stay inside the
|
|
18
|
+
* PCI-isolated Basis Theory components; this element only arranges them.
|
|
19
|
+
*/
|
|
20
|
+
export declare function CardElement({ layout, style, fallback, onChange, onReady, onError }: CardElementProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
//# sourceMappingURL=card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../../src/elements/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,KAAK,SAAS,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIhF,OAAO,EAEN,KAAK,uBAAuB,EAG5B,MAAM,0BAAuB,CAAC;AAG/B,MAAM,WAAW,gBAAgB;IAChC,+FAA+F;IAC/F,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC/B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,uBAAuB,KAAK,IAAI,CAAC;IACtD,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;CAC9D;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAAE,MAAkB,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,gBAAgB,2CAShH"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
export interface EmailChangePayload {
|
|
4
|
+
email: string;
|
|
5
|
+
complete: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface EmailElementProps {
|
|
8
|
+
/** Seed value applied once at mount. */
|
|
9
|
+
defaultValue?: string;
|
|
10
|
+
/** Shows the localized label. Set false when supplying your own; the input keeps its a11y label. */
|
|
11
|
+
label?: boolean;
|
|
12
|
+
/** Empty renders `you@example.com`. */
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
style?: StyleProp<ViewStyle>;
|
|
15
|
+
fallback?: ReactNode;
|
|
16
|
+
onChange?: (payload: EmailChangePayload) => void;
|
|
17
|
+
onReady?: () => void;
|
|
18
|
+
onError?: (error: {
|
|
19
|
+
message: string;
|
|
20
|
+
code?: string;
|
|
21
|
+
}) => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Collects the buyer's email and feeds it to `createConfirmationToken()` while mounted. An explicit
|
|
25
|
+
* `billingDetails.email` still wins.
|
|
26
|
+
*
|
|
27
|
+
* Account recognition and code sign-in are not in this release, so no sign-in affordance renders —
|
|
28
|
+
* nothing appears that cannot work.
|
|
29
|
+
*/
|
|
30
|
+
export declare function EmailElement({ defaultValue, label, placeholder, style, fallback, onChange, onReady, onError, }: EmailElementProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
//# sourceMappingURL=email.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../../../src/elements/email.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,OAAO,CAAC;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAUzD,MAAM,WAAW,kBAAkB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IACjC,wCAAwC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oGAAoG;IACpG,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACjD,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;CAC9D;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,EAC5B,YAAiB,EACjB,KAAY,EACZ,WAAgB,EAChB,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,OAAO,GACP,EAAE,iBAAiB,2CAqDnB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type MutableRefObject } from 'react';
|
|
2
|
+
import type { RequiredField } from '../../api/types.js';
|
|
3
|
+
import type { BasisTheoryElements } from '../../core/payments/bt.js';
|
|
4
|
+
import { type MatrixEntry } from '../../core/payments/detail.js';
|
|
5
|
+
export interface DeclaredFieldValues {
|
|
6
|
+
/** Fields the method wants on its own category payload. */
|
|
7
|
+
paymentMethod: Record<string, string>;
|
|
8
|
+
/** Fields the method wants on `billing_details`. */
|
|
9
|
+
billingExtra: Record<string, string>;
|
|
10
|
+
/** One token intent standing in for every `secure: true` field, keyed by field name. */
|
|
11
|
+
secureTokenIntent: string | undefined;
|
|
12
|
+
}
|
|
13
|
+
export interface DeclaredFieldsState {
|
|
14
|
+
fields: RequiredField[];
|
|
15
|
+
values: Record<string, string>;
|
|
16
|
+
setValue: (name: string, value: string) => void;
|
|
17
|
+
errorFor: (field: RequiredField) => 'required' | 'invalid' | undefined;
|
|
18
|
+
complete: boolean;
|
|
19
|
+
collect: () => Promise<DeclaredFieldValues>;
|
|
20
|
+
showErrors: boolean;
|
|
21
|
+
revealErrors: () => void;
|
|
22
|
+
secureRefs: MutableRefObject<Record<string, unknown>>;
|
|
23
|
+
/** The tokenizer key for this method's secure fields, if it declares any. */
|
|
24
|
+
tokenizerKey: string | undefined;
|
|
25
|
+
btRef: MutableRefObject<BasisTheoryElements | undefined>;
|
|
26
|
+
/** A hosted field's instance settles after its own first commit; this re-derives completeness
|
|
27
|
+
* when it does, since a ref assignment is invisible to React. */
|
|
28
|
+
noteSecureComplete: (key: string, complete: boolean) => void;
|
|
29
|
+
secureKey: (name: string) => string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A method's `required_fields`, rendered generically from what the matrix publishes.
|
|
33
|
+
*
|
|
34
|
+
* A `secure: true` field renders as a Basis Theory hosted text element, so the raw value never
|
|
35
|
+
* exists in this JavaScript. At collect time every secure instance is tokenized into ONE token
|
|
36
|
+
* intent keyed by field name, and the category payload carries `{ token_intent }` — the shape the
|
|
37
|
+
* web element produces and the backend already reads.
|
|
38
|
+
*/
|
|
39
|
+
export declare function useDeclaredFields(entry: MatrixEntry | undefined, country: string | undefined): DeclaredFieldsState;
|
|
40
|
+
export declare function DeclaredFields({ state }: {
|
|
41
|
+
state: DeclaredFieldsState;
|
|
42
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
43
|
+
//# sourceMappingURL=declared-fields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declared-fields.d.ts","sourceRoot":"","sources":["../../../../../src/elements/payment/declared-fields.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAqD,MAAM,OAAO,CAAC;AAGjG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAAwB,CAAC;AAClE,OAAO,EAA4B,KAAK,WAAW,EAAsB,MAAM,+BAA4B,CAAC;AAM5G,MAAM,WAAW,mBAAmB;IACnC,2DAA2D;IAC3D,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,oDAAoD;IACpD,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,wFAAwF;IACxF,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAED,MAAM,WAAW,mBAAmB;IACnC,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;IACvE,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC5C,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,UAAU,EAAE,gBAAgB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACtD,6EAA6E;IAC7E,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,KAAK,EAAE,gBAAgB,CAAC,mBAAmB,GAAG,SAAS,CAAC,CAAC;IACzD;sEACkE;IAClE,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7D,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACpC;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,mBAAmB,CAkGlH;AAED,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,mBAAmB,CAAA;CAAE,kDAkCvE"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
export interface PaymentChangePayload {
|
|
4
|
+
complete: boolean;
|
|
5
|
+
type?: string;
|
|
6
|
+
supportsBuyerFee?: boolean;
|
|
7
|
+
method?: {
|
|
8
|
+
type: string;
|
|
9
|
+
category: string;
|
|
10
|
+
template: string;
|
|
11
|
+
display_name: string;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface PaymentElementProps {
|
|
15
|
+
/** Method display order, Stripe's `paymentMethodOrder` semantics. Unlisted types keep their
|
|
16
|
+
* incoming relative order behind the listed ones. */
|
|
17
|
+
order?: string[];
|
|
18
|
+
style?: StyleProp<ViewStyle>;
|
|
19
|
+
fallback?: ReactNode;
|
|
20
|
+
onChange?: (payload: PaymentChangePayload) => void;
|
|
21
|
+
onReady?: () => void;
|
|
22
|
+
onError?: (error: {
|
|
23
|
+
message: string;
|
|
24
|
+
code?: string;
|
|
25
|
+
}) => void;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Shows the payment methods offered for this charge and collects the selected one's required
|
|
29
|
+
* fields.
|
|
30
|
+
*
|
|
31
|
+
* The offered set is the matrix filtered by the same eight `presentMethod` gates the web element
|
|
32
|
+
* applies, from the same inputs. The surface is declared `direct_checkout` because an app owns its
|
|
33
|
+
* own presentation the way a first-party document does — and unlike an iframe it can hand a
|
|
34
|
+
* full-page step to the system browser, so `full_page`-only methods stay in the list.
|
|
35
|
+
*/
|
|
36
|
+
export declare function PaymentElement({ order, style, fallback, onChange, onReady, onError }: PaymentElementProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/elements/payment/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAqD,MAAM,OAAO,CAAC;AAC1F,OAAO,EAAuB,KAAK,SAAS,EAA0B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AA4B3G,MAAM,WAAW,oBAAoB;IACpC,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,MAAM,CAAC,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;KACrB,CAAC;CACF;AAED,MAAM,WAAW,mBAAmB;IACnC;0DACsD;IACtD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACnD,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;CAC9D;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,mBAAmB,2CAuVzG"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { MatrixEntry } from '../../core/payments/detail.js';
|
|
2
|
+
import { type WalletContact } from '../../core/payments/wallet-contact.js';
|
|
3
|
+
import { type WalletSheetRequest } from '../../native/index.js';
|
|
4
|
+
export interface WalletChargeContext {
|
|
5
|
+
currency: string;
|
|
6
|
+
/** Minor units, the way the charge config carries it. */
|
|
7
|
+
amount: number;
|
|
8
|
+
merchantName: string;
|
|
9
|
+
applePayMerchantId: string | undefined;
|
|
10
|
+
requiresBillingAddress: boolean;
|
|
11
|
+
requiresEmail: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* PassKit and the Google Pay API replace the web element's merchant-validation ceremony entirely:
|
|
15
|
+
* the app's own merchant identifier and on-device certificate prove the merchant, so the
|
|
16
|
+
* origin-clearance gates the web wallet lane carries have no counterpart here.
|
|
17
|
+
*/
|
|
18
|
+
export declare function walletRequestFor(entry: MatrixEntry, charge: WalletChargeContext): WalletSheetRequest | null;
|
|
19
|
+
/**
|
|
20
|
+
* Presents the OS sheet and turns its payload into the confirmation-token payment method.
|
|
21
|
+
*
|
|
22
|
+
* The raw network payload goes straight to Basis Theory as a token intent — byte-identical to what
|
|
23
|
+
* the web wallet lane posts — so the backend sees the same `{ token_intent }` from either platform.
|
|
24
|
+
*/
|
|
25
|
+
export declare function collectWallet(entry: MatrixEntry, request: WalletSheetRequest): Promise<{
|
|
26
|
+
paymentMethod: {
|
|
27
|
+
type: string;
|
|
28
|
+
category: string;
|
|
29
|
+
[key: string]: unknown;
|
|
30
|
+
};
|
|
31
|
+
contact: WalletContact;
|
|
32
|
+
}>;
|
|
33
|
+
/** Probes whether the OS will present a sheet at all; a false answer hides the tile entirely. */
|
|
34
|
+
export declare function useWalletAvailability(entry: MatrixEntry | undefined): boolean | undefined;
|
|
35
|
+
export declare function WalletPayButton({ onPress, disabled }: {
|
|
36
|
+
onPress: () => void;
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
//# sourceMappingURL=wallet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../../../../src/elements/payment/wallet.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA4B,CAAC;AAG9D,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,uCAAoC,CAAC;AACzF,OAAO,EAIN,KAAK,kBAAkB,EACvB,MAAM,uBAAc,CAAC;AAGtB,MAAM,WAAW,mBAAmB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,sBAAsB,EAAE,OAAO,CAAC;IAChC,aAAa,EAAE,OAAO,CAAC;CACvB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,mBAAmB,GAAG,kBAAkB,GAAG,IAAI,CA6B3G;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CAClC,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,kBAAkB,GACzB,OAAO,CAAC;IACV,aAAa,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAC1E,OAAO,EAAE,aAAa,CAAC;CACvB,CAAC,CAgCD;AAID,iGAAiG;AACjG,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CA2BzF;AAED,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,IAAI,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,2CAcjG"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { type TaxIdType } from '../core/payments/tax-id-catalog.js';
|
|
4
|
+
export interface TaxIdChangePayload {
|
|
5
|
+
taxId: {
|
|
6
|
+
type: TaxIdType;
|
|
7
|
+
value: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export interface TaxIdElementProps {
|
|
11
|
+
/**
|
|
12
|
+
* ISO 3166-1 alpha-2 buyer country used to preselect the type. `AR` selects `ar_cuit`. EU and
|
|
13
|
+
* unmapped or empty values select `eu_vat`. A manual selection persists across country changes.
|
|
14
|
+
*/
|
|
15
|
+
country?: string;
|
|
16
|
+
/** Initial `type` and `value` from a resumed session. An unsupported type falls back. */
|
|
17
|
+
defaultValue?: {
|
|
18
|
+
type: string;
|
|
19
|
+
value: string;
|
|
20
|
+
};
|
|
21
|
+
/** Disables both fields while the host saves the last committed registration. */
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/** API validation error shown below the value input. */
|
|
24
|
+
error?: string;
|
|
25
|
+
style?: StyleProp<ViewStyle>;
|
|
26
|
+
fallback?: ReactNode;
|
|
27
|
+
onChange?: (payload: TaxIdChangePayload) => void;
|
|
28
|
+
onReady?: () => void;
|
|
29
|
+
onError?: (error: {
|
|
30
|
+
message: string;
|
|
31
|
+
code?: string;
|
|
32
|
+
}) => void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Collects a business tax registration. `onChange` emits committed pairs only — on blur or submit
|
|
36
|
+
* with a non-empty value, or on a type change while a value is present. Identical consecutive
|
|
37
|
+
* values fire once, and clearing the value does not fire, so the host must clear stored
|
|
38
|
+
* registrations itself.
|
|
39
|
+
*/
|
|
40
|
+
export declare function TaxIdElement({ country, defaultValue, disabled, error, style, fallback, onChange, onReady, onError, }: TaxIdElementProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
//# sourceMappingURL=tax-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tax-id.d.ts","sourceRoot":"","sources":["../../../../src/elements/tax-id.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAqD,MAAM,OAAO,CAAC;AAC1F,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,EAKN,KAAK,SAAS,EAEd,MAAM,oCAAiC,CAAC;AAMzC,MAAM,WAAW,kBAAkB;IAClC,KAAK,EAAE;QAAE,IAAI,EAAE,SAAS,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAC1C;AAED,MAAM,WAAW,iBAAiB;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yFAAyF;IACzF,YAAY,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/C,iFAAiF;IACjF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACjD,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;CAC9D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,EAC5B,OAAY,EACZ,YAAY,EACZ,QAAgB,EAChB,KAAK,EACL,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,OAAO,GACP,EAAE,iBAAiB,2CAuFnB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keys are the English source strings, matching the web elements' `useExtracted()` keys exactly, so
|
|
3
|
+
* a translation written for one surface fits the other. English needs no catalog: a miss renders the
|
|
4
|
+
* key, which is already the English copy.
|
|
5
|
+
*/
|
|
6
|
+
export declare const CATALOGS: Record<string, Record<string, string> | undefined>;
|
|
7
|
+
//# sourceMappingURL=catalogs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogs.d.ts","sourceRoot":"","sources":["../../../../src/i18n/catalogs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CA8FvE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Message lookup keyed by the English source string, the same shape `useExtracted()` gives the web
|
|
4
|
+
* elements — so a key here is the key there and translations move between them unchanged.
|
|
5
|
+
*
|
|
6
|
+
* A missing catalog entry renders the key, which IS the English copy. That is the correct failure:
|
|
7
|
+
* an untranslated string beats a blank one.
|
|
8
|
+
*/
|
|
9
|
+
export type Translate = (key: string, params?: Record<string, string | number>) => string;
|
|
10
|
+
export declare function LocaleProvider({ locale, children }: {
|
|
11
|
+
locale?: string;
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
}): ReactNode;
|
|
14
|
+
export declare function useLocale(): string;
|
|
15
|
+
export declare function useT(): Translate;
|
|
16
|
+
export declare function translator(locale: string): Translate;
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/i18n/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAK1F;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC;AAI1F,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CAExG;AAED,wBAAgB,SAAS,IAAI,MAAM,CAGlC;AAED,wBAAgB,IAAI,IAAI,SAAS,CAGhC;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAUpD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@whop/elements-react-native` — native React Native components for collecting payments.
|
|
3
|
+
*
|
|
4
|
+
* The surface mirrors `@whop/elements-react`: a root provider, one namespace provider, one
|
|
5
|
+
* component per element, a hook for the live handle, and one `appearance` object. The deltas are
|
|
6
|
+
* documented on the types that carry them — `style` is a React Native style, `appearance.tokens`
|
|
7
|
+
* replaces CSS variables, `appearance.parts` replaces CSS classes, and there is no `elements`
|
|
8
|
+
* loader prop because there is no hosted script to load.
|
|
9
|
+
*/
|
|
10
|
+
export { WhopElements } from './provider.js';
|
|
11
|
+
export type { WhopElementsConfig, WhopElementsProps } from './provider.js';
|
|
12
|
+
export { Payments, usePayments } from './namespace.js';
|
|
13
|
+
export type { PaymentsHandle, PaymentsProviderProps } from './namespace.js';
|
|
14
|
+
export type { PaymentsOptions, PaymentsState } from './controller/store.js';
|
|
15
|
+
export type { CreateConfirmationTokenInput, CreateConfirmationTokenResult, HandleNextActionInput, HandleNextActionResult, } from './controller/actions.js';
|
|
16
|
+
export { PaymentElement } from './elements/payment/index.js';
|
|
17
|
+
export type { PaymentChangePayload, PaymentElementProps } from './elements/payment/index.js';
|
|
18
|
+
export { AddressElement } from './elements/address.js';
|
|
19
|
+
export type { AddressChangePayload, AddressElementProps } from './elements/address.js';
|
|
20
|
+
export { CardElement } from './elements/card.js';
|
|
21
|
+
export type { CardElementProps } from './elements/card.js';
|
|
22
|
+
export { CardCvcElement, CardExpiryElement, CardFields, CardNumberElement } from './elements/card-fields/index.js';
|
|
23
|
+
export type { CardFieldProps, CardFieldsChangePayload, CardFieldsProps } from './elements/card-fields/index.js';
|
|
24
|
+
export { EmailElement } from './elements/email.js';
|
|
25
|
+
export type { EmailChangePayload, EmailElementProps } from './elements/email.js';
|
|
26
|
+
export { TaxIdElement } from './elements/tax-id.js';
|
|
27
|
+
export type { TaxIdChangePayload, TaxIdElementProps } from './elements/tax-id.js';
|
|
28
|
+
export { BrandingElement } from './elements/branding.js';
|
|
29
|
+
export type { BrandingElementProps } from './elements/branding.js';
|
|
30
|
+
export type { AccentColor, Appearance, GrayColor, Parts, PartName, Theme, Tokens, } from './theme/appearance.js';
|
|
31
|
+
export { useTheme } from './theme/provider.js';
|
|
32
|
+
export type { ResolvedTheme } from './theme/provider.js';
|
|
33
|
+
export { API_BASES, WhopError } from './api/client.js';
|
|
34
|
+
export type { WhopEnvironment } from './api/client.js';
|
|
35
|
+
export { BrandingRequiredError, ChargeConfigError, PaymentTokenizationError } from './core/payments/errors.js';
|
|
36
|
+
export { PaymentsRefusalError } from './core/payments/refusals.js';
|
|
37
|
+
export type { PaymentsRefusalCode } from './core/payments/refusals.js';
|
|
38
|
+
export type { TaxIdType } from './core/payments/tax-id-catalog.js';
|
|
39
|
+
export type { EmittedAddress } from './core/address/engine.js';
|
|
40
|
+
export { WhopAuthSession, WhopPlatformPay } from './native/index.js';
|
|
41
|
+
export type { WalletCapability } from './native/index.js';
|
|
42
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAY,CAAC;AAC1C,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,eAAY,CAAC;AAExE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,gBAAa,CAAC;AACpD,YAAY,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,gBAAa,CAAC;AACzE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,uBAAoB,CAAC;AACzE,YAAY,EACX,4BAA4B,EAC5B,6BAA6B,EAC7B,qBAAqB,EACrB,sBAAsB,GACtB,MAAM,yBAAsB,CAAC;AAE9B,OAAO,EAAE,cAAc,EAAE,MAAM,6BAAoB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,6BAAoB,CAAC;AAEpF,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAoB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,uBAAoB,CAAC;AAEpF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAiB,CAAC;AAC9C,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAiB,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,iCAAwB,CAAC;AAC1G,YAAY,EAAE,cAAc,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,iCAAwB,CAAC;AAEvG,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAkB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,qBAAkB,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAmB,CAAC;AACjD,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,sBAAmB,CAAC;AAE/E,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAqB,CAAC;AACtD,YAAY,EAAE,oBAAoB,EAAE,MAAM,wBAAqB,CAAC;AAEhE,YAAY,EACX,WAAW,EACX,UAAU,EACV,SAAS,EACT,KAAK,EACL,QAAQ,EACR,KAAK,EACL,MAAM,GACN,MAAM,uBAAoB,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAkB,CAAC;AAC5C,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAkB,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAc,CAAC;AACpD,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAc,CAAC;AAEpD,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,2BAAwB,CAAC;AAC5G,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA0B,CAAC;AAChE,YAAY,EAAE,mBAAmB,EAAE,MAAM,6BAA0B,CAAC;AAEpE,YAAY,EAAE,SAAS,EAAE,MAAM,mCAAgC,CAAC;AAChE,YAAY,EAAE,cAAc,EAAE,MAAM,0BAAuB,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,mBAAU,CAAC;AAC5D,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAU,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import { type CreateConfirmationTokenInput, type CreateConfirmationTokenResult, type HandleNextActionInput, type HandleNextActionResult } from './controller/actions.js';
|
|
4
|
+
import { type PaymentsOptions, type PaymentsState, PaymentsStore } from './controller/store.js';
|
|
5
|
+
/** The live handle a `<Payments>` ref exposes — the same surface the vanilla handle carries. */
|
|
6
|
+
export interface PaymentsHandle {
|
|
7
|
+
createConfirmationToken(input?: CreateConfirmationTokenInput): Promise<CreateConfirmationTokenResult>;
|
|
8
|
+
handleNextAction(input: HandleNextActionInput): Promise<HandleNextActionResult>;
|
|
9
|
+
getState(): PaymentsState;
|
|
10
|
+
subscribe(listener: () => void): () => void;
|
|
11
|
+
update(options: PaymentsOptions): void;
|
|
12
|
+
/** @internal the store the element components bind to */
|
|
13
|
+
readonly store: PaymentsStore;
|
|
14
|
+
}
|
|
15
|
+
export declare function usePayments(): PaymentsHandle | null;
|
|
16
|
+
/** @internal every element reads the store through this, never the context directly. */
|
|
17
|
+
export declare function usePaymentsStore(): PaymentsStore;
|
|
18
|
+
/** @internal a selected slice of controller state, re-rendering only when the slice moves. */
|
|
19
|
+
export declare function usePaymentsState<T>(select: (state: PaymentsState) => T): T;
|
|
20
|
+
export interface PaymentsProviderProps extends PaymentsOptions {
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
/** Shown until every child element has loaded. Grouped, exactly like the web provider's. */
|
|
23
|
+
fallback?: ReactNode;
|
|
24
|
+
style?: StyleProp<ViewStyle>;
|
|
25
|
+
onError?: (error: {
|
|
26
|
+
message: string;
|
|
27
|
+
code?: string;
|
|
28
|
+
}) => void;
|
|
29
|
+
onLoadingChange?: (loading: boolean) => void;
|
|
30
|
+
}
|
|
31
|
+
export declare const Payments: import("react").ForwardRefExoticComponent<PaymentsProviderProps & import("react").RefAttributes<PaymentsHandle | null>>;
|
|
32
|
+
/** @internal element components call this on mount so the group latch knows to wait for them. */
|
|
33
|
+
export declare function useGroupMember(): {
|
|
34
|
+
ready: () => void;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=namespace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namespace.d.ts","sourceRoot":"","sources":["../../../src/namespace.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGN,KAAK,SAAS,EAQd,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,KAAK,SAAS,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhF,OAAO,EAEN,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EAElC,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,MAAM,yBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,aAAa,EAAE,aAAa,EAAE,MAAM,uBAAoB,CAAC;AAG7F,gGAAgG;AAChG,MAAM,WAAW,cAAc;IAC9B,uBAAuB,CAAC,KAAK,CAAC,EAAE,4BAA4B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;IACtG,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAChF,QAAQ,IAAI,aAAa,CAAC;IAC1B,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IAC5C,MAAM,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IACvC,yDAAyD;IACzD,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;CAC9B;AAID,wBAAgB,WAAW,IAAI,cAAc,GAAG,IAAI,CAInD;AAED,wFAAwF;AACxF,wBAAgB,gBAAgB,IAAI,aAAa,CAIhD;AAED,8FAA8F;AAC9F,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,CAAC,GAAG,CAAC,CAM1E;AAED,MAAM,WAAW,qBAAsB,SAAQ,eAAe;IAC7D,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,4FAA4F;IAC5F,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC9D,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CAC7C;AAED,eAAO,MAAM,QAAQ,yHA4EnB,CAAC;AAEH,iGAAiG;AACjG,wBAAgB,cAAc,IAAI;IAAE,KAAK,EAAE,MAAM,IAAI,CAAA;CAAE,CAuBtD"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { ParsedPlaceAddress } from '../core/address/places.js';
|
|
2
|
+
import type { AddressSuggestion } from '../core/address/suggest.js';
|
|
3
|
+
export declare const WhopAuthSession: {
|
|
4
|
+
isAvailable(): boolean;
|
|
5
|
+
/** Resolves the callback URL, or null when the buyer dismissed the browser. */
|
|
6
|
+
present(url: string, options?: {
|
|
7
|
+
callbackScheme?: string;
|
|
8
|
+
prefersEphemeral?: boolean;
|
|
9
|
+
}): Promise<string | null>;
|
|
10
|
+
dismiss(): void;
|
|
11
|
+
};
|
|
12
|
+
export interface WalletSheetConfig {
|
|
13
|
+
networks: string[];
|
|
14
|
+
allowedCardNetworks?: string[];
|
|
15
|
+
allowedAuthMethods?: string[];
|
|
16
|
+
environment?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface WalletSheetRequest extends WalletSheetConfig {
|
|
19
|
+
merchantIdentifier: string;
|
|
20
|
+
merchantName?: string;
|
|
21
|
+
countryCode: string;
|
|
22
|
+
currencyCode: string;
|
|
23
|
+
/** Major units as a decimal string; PassKit and Google Pay both price in major units. */
|
|
24
|
+
totalPrice: string;
|
|
25
|
+
lineItems: Array<{
|
|
26
|
+
label: string;
|
|
27
|
+
amount: string;
|
|
28
|
+
}>;
|
|
29
|
+
requiresBillingAddress: boolean;
|
|
30
|
+
requiresEmail: boolean;
|
|
31
|
+
gateway?: string;
|
|
32
|
+
gatewayMerchantId?: string;
|
|
33
|
+
}
|
|
34
|
+
export type WalletCapability = 'apple' | 'google' | 'none';
|
|
35
|
+
export declare const WhopPlatformPay: {
|
|
36
|
+
capability(): WalletCapability;
|
|
37
|
+
canPay(config: WalletSheetConfig): Promise<boolean>;
|
|
38
|
+
/** Resolves the raw network payload, or null when the buyer dismissed the sheet. */
|
|
39
|
+
present(request: WalletSheetRequest): Promise<string | null>;
|
|
40
|
+
/** Apple's sheet stays open until the confirm outcome is known; Google's dismisses itself. */
|
|
41
|
+
complete(success: boolean): void;
|
|
42
|
+
};
|
|
43
|
+
export declare const WALLET_TYPE_FOR_PLATFORM: string;
|
|
44
|
+
export { default as WhopPayButton } from '../specs/WhopPayButtonNativeComponent';
|
|
45
|
+
/**
|
|
46
|
+
* Street suggestions from the platform geocoder: MapKit on iOS, android.location.Geocoder on
|
|
47
|
+
* Android. No key, no account, no third-party SDK on either side.
|
|
48
|
+
*
|
|
49
|
+
* Two calls, because MapKit's as-you-type API answers with display strings only and the components
|
|
50
|
+
* come from a second lookup. Android resolves from its own cache, so the shape costs it nothing.
|
|
51
|
+
*
|
|
52
|
+
* Every failure path answers empty rather than throwing. A geocoder that is missing, throttled,
|
|
53
|
+
* offline or simply unhelpful should leave the buyer typing the address by hand, which is where
|
|
54
|
+
* they started — it must never take down a checkout.
|
|
55
|
+
*/
|
|
56
|
+
export declare const WhopAddressSuggestions: {
|
|
57
|
+
isAvailable(): boolean;
|
|
58
|
+
suggest(query: string): Promise<AddressSuggestion[]>;
|
|
59
|
+
/** `formCountry` is not sent to the geocoder; it backfills a result that comes back without one. */
|
|
60
|
+
resolve(id: string, formCountry?: string): Promise<ParsedPlaceAddress | null>;
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/native/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAAyB,CAAC;AAwCjE,eAAO,MAAM,eAAe;mBACZ,OAAO;IAGtB,+EAA+E;iBAClE,MAAM,YAAY;QAAE,cAAc,CAAC,EAAE,MAAM,CAAC;QAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;eAWpG,IAAI;CAGf,CAAC;AAEF,MAAM,WAAW,iBAAiB;IACjC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB;IAC5D,kBAAkB,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,yFAAyF;IACzF,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpD,sBAAsB,EAAE,OAAO,CAAC;IAChC,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE3D,eAAO,MAAM,eAAe;kBACb,gBAAgB;mBAIT,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;IASzD,oFAAoF;qBACnE,kBAAkB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAK5D,8FAA8F;sBAC5E,OAAO,GAAG,IAAI;CAGhC,CAAC;AAEF,eAAO,MAAM,wBAAwB,QAAqD,CAAC;AAE3F,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAuBjF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB;mBACnB,OAAO;mBAGD,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAS1D,oGAAoG;gBAClF,MAAM,gBAAgB,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;CASnF,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { WhopEnvironment } from './api/client.js';
|
|
3
|
+
import { type Appearance } from './theme/appearance.js';
|
|
4
|
+
export interface WhopElementsConfig {
|
|
5
|
+
/**
|
|
6
|
+
* Which Whop API the elements talk to. An ENUM over two Whop-owned origins, never a URL: a
|
|
7
|
+
* consumer-supplied host would let the embedding app read everything a buyer types.
|
|
8
|
+
*/
|
|
9
|
+
environment?: WhopEnvironment;
|
|
10
|
+
appearance?: Appearance | null;
|
|
11
|
+
locale?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Resolves a buyer or account token per request. There is no cookie in an app, so this is how a
|
|
14
|
+
* surface that needs credentials gets them. Called again before every call, so fetch rather than
|
|
15
|
+
* cache.
|
|
16
|
+
*/
|
|
17
|
+
getToken?: () => Promise<string | null | undefined> | string | null | undefined;
|
|
18
|
+
/** Opt in to the same event names and property allowlists the web elements emit. */
|
|
19
|
+
analytics?: {
|
|
20
|
+
writeKey: string;
|
|
21
|
+
} | false;
|
|
22
|
+
}
|
|
23
|
+
export interface WhopElementsProps extends WhopElementsConfig {
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated There is no hosted script to load on React Native — the elements are in this
|
|
27
|
+
* package. Remove the prop.
|
|
28
|
+
*/
|
|
29
|
+
elements?: never;
|
|
30
|
+
}
|
|
31
|
+
export declare function useRootConfig(): WhopElementsConfig;
|
|
32
|
+
/**
|
|
33
|
+
* The root. Holds the environment, the appearance, the locale, and the token resolver, and puts a
|
|
34
|
+
* resolved theme in context for every element beneath it.
|
|
35
|
+
*/
|
|
36
|
+
export declare function WhopElements(props: WhopElementsProps): ReactNode;
|
|
37
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAE3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAc,CAAC;AACpD,OAAO,EAAE,KAAK,UAAU,EAA0B,MAAM,uBAAoB,CAAC;AAI7E,MAAM,WAAW,kBAAkB;IAClC;;;OAGG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,UAAU,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAChF,oFAAoF;IACpF,SAAS,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,KAAK,CAAC;CACzC;AAED,MAAM,WAAW,iBAAkB,SAAQ,kBAAkB;IAC5D,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC;CACjB;AAQD,wBAAgB,aAAa,IAAI,kBAAkB,CAIlD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,CAyBhE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
export interface Spec extends TurboModule {
|
|
3
|
+
/** Whether the platform has a geocoder to ask. Android devices can ship without a backend. */
|
|
4
|
+
isAvailable(): boolean;
|
|
5
|
+
/** Candidates for a partial address, as a JSON array of `{ id, label }`. Display only. */
|
|
6
|
+
suggest(query: string): Promise<string>;
|
|
7
|
+
/** One candidate's raw components as JSON, by the `id` its `suggest` row carried. */
|
|
8
|
+
details(suggestionId: string): Promise<string>;
|
|
9
|
+
}
|
|
10
|
+
/** `get`, not `getEnforcing`: an app that has not rebuilt loses suggestions, it does not crash. */
|
|
11
|
+
declare const _default: Spec | null | undefined;
|
|
12
|
+
export default _default;
|
|
13
|
+
//# sourceMappingURL=NativeWhopAddressSuggestions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeWhopAddressSuggestions.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeWhopAddressSuggestions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACxC,8FAA8F;IAC9F,WAAW,IAAI,OAAO,CAAC;IACvB,0FAA0F;IAC1F,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACxC,qFAAqF;IACrF,OAAO,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC/C;AAED,mGAAmG;;AACnG,wBAAuE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
export interface Spec extends TurboModule {
|
|
3
|
+
isAvailable(): boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Presents `url` in the system browser — ASWebAuthenticationSession on iOS, a Chrome Custom
|
|
6
|
+
* Tab on Android. Resolves with the callback URL when one arrives, or null when the buyer
|
|
7
|
+
* dismissed it. Never an in-app WebView: the page runs out of process, so the host app can
|
|
8
|
+
* neither read nor script it.
|
|
9
|
+
*/
|
|
10
|
+
present(url: string, callbackScheme: string | null, prefersEphemeral: boolean): Promise<string | null>;
|
|
11
|
+
dismiss(): void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* `get`, not `getEnforcing`: a host app that has not rebuilt since adding this package should lose
|
|
15
|
+
* the redirect and wallet surfaces, not crash on import. The wrappers in src/native treat null as
|
|
16
|
+
* "unavailable".
|
|
17
|
+
*/
|
|
18
|
+
declare const _default: Spec | null | undefined;
|
|
19
|
+
export default _default;
|
|
20
|
+
//# sourceMappingURL=NativeWhopAuthSession.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeWhopAuthSession.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeWhopAuthSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACxC,WAAW,IAAI,OAAO,CAAC;IACvB;;;;;OAKG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI,EAAE,gBAAgB,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACvG,OAAO,IAAI,IAAI,CAAC;CAChB;AAED;;;;GAIG;;AACH,wBAAgE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
export interface Spec extends TurboModule {
|
|
3
|
+
/** 'apple' on iOS, 'google' on Android, 'none' where neither is usable. */
|
|
4
|
+
capability(): string;
|
|
5
|
+
/** `configJson` is a WalletSheetConfig. Answers whether the OS will present a sheet at all. */
|
|
6
|
+
canPay(configJson: string): Promise<boolean>;
|
|
7
|
+
/**
|
|
8
|
+
* Presents the OS wallet sheet for a WalletSheetRequest. Resolves with the raw network payload
|
|
9
|
+
* as a JSON string — PKPaymentToken.paymentData on iOS, PaymentData's tokenization token on
|
|
10
|
+
* Android — or null when the buyer dismissed it. The payload goes straight to Basis Theory as a
|
|
11
|
+
* token intent; it never enters the SDK's own state.
|
|
12
|
+
*/
|
|
13
|
+
present(requestJson: string): Promise<string | null>;
|
|
14
|
+
/** Settles a presented sheet once the confirm outcome is known. */
|
|
15
|
+
complete(success: boolean): void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* `get`, not `getEnforcing`: a host app that has not rebuilt since adding this package should lose
|
|
19
|
+
* the redirect and wallet surfaces, not crash on import. The wrappers in src/native treat null as
|
|
20
|
+
* "unavailable".
|
|
21
|
+
*/
|
|
22
|
+
declare const _default: Spec | null | undefined;
|
|
23
|
+
export default _default;
|
|
24
|
+
//# sourceMappingURL=NativeWhopPlatformPay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeWhopPlatformPay.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeWhopPlatformPay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACxC,2EAA2E;IAC3E,UAAU,IAAI,MAAM,CAAC;IACrB,+FAA+F;IAC/F,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C;;;;;OAKG;IACH,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACrD,mEAAmE;IACnE,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;CACjC;AAED;;;;GAIG;;AACH,wBAAgE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { CodegenTypes, HostComponent, ViewProps } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* The platform's own pay button. Apple and Google both require their branded control rather than a
|
|
4
|
+
* drawn imitation, so this is the one element surface that must be a native view.
|
|
5
|
+
*/
|
|
6
|
+
export interface NativeProps extends ViewProps {
|
|
7
|
+
variant?: CodegenTypes.WithDefault<'buy' | 'pay' | 'checkout' | 'book' | 'subscribe' | 'order', 'pay'>;
|
|
8
|
+
buttonAppearance?: CodegenTypes.WithDefault<'auto' | 'light' | 'dark', 'auto'>;
|
|
9
|
+
cornerRadius?: CodegenTypes.Double;
|
|
10
|
+
disabled?: CodegenTypes.WithDefault<boolean, false>;
|
|
11
|
+
/**
|
|
12
|
+
* NOT `onPress`. Codegen derives the native event name by replacing the `on` prefix with `top`,
|
|
13
|
+
* and React Native already registers `topPress` as a BUBBLING event for Pressable — a name
|
|
14
|
+
* registered as both direct and bubbling fails the view-config invariant at render time, which
|
|
15
|
+
* takes down the whole screen rather than just this button.
|
|
16
|
+
*/
|
|
17
|
+
onPayPress?: CodegenTypes.DirectEventHandler<null>;
|
|
18
|
+
}
|
|
19
|
+
declare const _default: HostComponent<NativeProps>;
|
|
20
|
+
export default _default;
|
|
21
|
+
//# sourceMappingURL=WhopPayButtonNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WhopPayButtonNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/WhopPayButtonNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG3E;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC7C,OAAO,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,KAAK,GAAG,KAAK,GAAG,UAAU,GAAG,MAAM,GAAG,WAAW,GAAG,OAAO,EAAE,KAAK,CAAC,CAAC;IACvG,gBAAgB,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/E,YAAY,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC;IACnC,QAAQ,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACpD;;;;;OAKG;IACH,UAAU,CAAC,EAAE,YAAY,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;CACnD;wBAEsE,aAAa,CAAC,WAAW,CAAC;AAAjG,wBAAkG"}
|