@stigg/react-sdk 7.7.1-beta.1 → 7.8.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/dist/index.d.ts +2 -938
- package/dist/react-sdk.cjs.js +3444 -712
- package/dist/react-sdk.cjs.js.map +1 -0
- package/dist/react-sdk.esm.js +76842 -12328
- package/dist/react-sdk.esm.js.map +1 -0
- package/dist/react-sdk.umd.js +6238 -0
- package/dist/react-sdk.umd.js.map +1 -0
- package/dist/src/assets/lottie/checkout-success.json.d.ts +3 -0
- package/dist/src/components/StiggProvider.d.ts +36 -0
- package/dist/src/components/checkout/Checkout.d.ts +5 -0
- package/dist/src/components/checkout/CheckoutContainer.d.ts +14 -0
- package/dist/src/components/checkout/CheckoutContainer.style.d.ts +15 -0
- package/dist/src/components/checkout/CheckoutProvider.d.ts +43 -0
- package/dist/src/components/checkout/components/Button.d.ts +6 -0
- package/dist/src/components/checkout/components/ChangePlanButton.d.ts +7 -0
- package/dist/src/components/checkout/components/ContentLoadingSkeleton.d.ts +2 -0
- package/dist/src/components/checkout/components/DowngradeToFreeContainer.d.ts +21 -0
- package/dist/src/components/checkout/components/InputField.d.ts +6 -0
- package/dist/src/components/checkout/components/Skeletons.style.d.ts +27 -0
- package/dist/src/components/checkout/components/StyledArrow.d.ts +4 -0
- package/dist/src/components/checkout/components/index.d.ts +3 -0
- package/dist/src/components/checkout/configurations/steps.d.ts +1 -0
- package/dist/src/components/checkout/configurations/textOverrides.d.ts +82 -0
- package/dist/src/components/checkout/configurations/theme.d.ts +14 -0
- package/dist/src/components/checkout/configurations/typography.d.ts +7 -0
- package/dist/src/components/checkout/formatting.d.ts +2 -0
- package/dist/src/components/checkout/hooks/index.d.ts +8 -0
- package/dist/src/components/checkout/hooks/useAddonsStepModel.d.ts +20 -0
- package/dist/src/components/checkout/hooks/useCheckoutModel.d.ts +14 -0
- package/dist/src/components/checkout/hooks/useCouponModel.d.ts +7 -0
- package/dist/src/components/checkout/hooks/useLoadCheckout.d.ts +14 -0
- package/dist/src/components/checkout/hooks/usePaymentStepModel.d.ts +22 -0
- package/dist/src/components/checkout/hooks/usePlanStepModel.d.ts +23 -0
- package/dist/src/components/checkout/hooks/usePreviewSubscription.d.ts +25 -0
- package/dist/src/components/checkout/hooks/useProgressBarModel.d.ts +35 -0
- package/dist/src/components/checkout/hooks/useSubscriptionModel.d.ts +6 -0
- package/dist/src/components/checkout/hooks/useSubscriptionState.d.ts +2 -0
- package/dist/src/components/checkout/index.d.ts +8 -0
- package/dist/src/components/checkout/planHeader/PlanHeader.d.ts +6 -0
- package/dist/src/components/checkout/planHeader/index.d.ts +1 -0
- package/dist/src/components/checkout/progressBar/CheckoutProgressBar.d.ts +1 -0
- package/dist/src/components/checkout/progressBar/CheckoutProgressBar.style.d.ts +17 -0
- package/dist/src/components/checkout/promotionCode/AddPromotionCode.d.ts +2 -0
- package/dist/src/components/checkout/promotionCode/AddPromotionCodeButton.d.ts +7 -0
- package/dist/src/components/checkout/promotionCode/AppliedPromotionCode.d.ts +10 -0
- package/dist/src/components/checkout/promotionCode/PromotionCodeSection.d.ts +8 -0
- package/dist/src/components/checkout/promotionCode/index.d.ts +1 -0
- package/dist/src/components/checkout/steps/addons/CheckoutAddonsStep.d.ts +4 -0
- package/dist/src/components/checkout/steps/addons/CheckoutAddonsStep.style.d.ts +18 -0
- package/dist/src/components/checkout/steps/addons/addon.utils.d.ts +15 -0
- package/dist/src/components/checkout/steps/addons/components/AddonInputContainer.d.ts +15 -0
- package/dist/src/components/checkout/steps/addons/components/AddonTextContainer.d.ts +9 -0
- package/dist/src/components/checkout/steps/addons/index.d.ts +1 -0
- package/dist/src/components/checkout/steps/payment/PaymentMethods.d.ts +19 -0
- package/dist/src/components/checkout/steps/payment/PaymentMethods.style.d.ts +27 -0
- package/dist/src/components/checkout/steps/payment/PaymentStep.d.ts +2 -0
- package/dist/src/components/checkout/steps/payment/index.d.ts +1 -0
- package/dist/src/components/checkout/steps/payment/stripe/StripePaymentForm.d.ts +2 -0
- package/dist/src/components/checkout/steps/payment/stripe/index.d.ts +3 -0
- package/dist/src/components/checkout/steps/payment/stripe/stripe.utils.d.ts +33 -0
- package/dist/src/components/checkout/steps/payment/stripe/useStripeIntegration.d.ts +5 -0
- package/dist/src/components/checkout/steps/payment/stripe/useSubmit.d.ts +15 -0
- package/dist/src/components/checkout/steps/payment/zuora/ZuoraPaymentForm.d.ts +2 -0
- package/dist/src/components/checkout/steps/payment/zuora/index.d.ts +4 -0
- package/dist/src/components/checkout/steps/payment/zuora/useZuoraIntegration.d.ts +5 -0
- package/dist/src/components/checkout/steps/payment/zuora/useZuoraSubmit.d.ts +11 -0
- package/dist/src/components/checkout/steps/payment/zuora/zuora.utils.d.ts +34 -0
- package/dist/src/components/checkout/steps/plan/BillingPeriodPicker.d.ts +8 -0
- package/dist/src/components/checkout/steps/plan/BillingPeriodPicker.style.d.ts +28 -0
- package/dist/src/components/checkout/steps/plan/CheckoutChargeList.d.ts +22 -0
- package/dist/src/components/checkout/steps/plan/CheckoutPlanStep.d.ts +2 -0
- package/dist/src/components/checkout/steps/plan/CheckoutPlanStep.style.d.ts +6 -0
- package/dist/src/components/checkout/steps/plan/index.d.ts +1 -0
- package/dist/src/components/checkout/summary/CheckoutSuccess.d.ts +5 -0
- package/dist/src/components/checkout/summary/CheckoutSummary.d.ts +15 -0
- package/dist/src/components/checkout/summary/CheckoutSummarySkeleton.d.ts +3 -0
- package/dist/src/components/checkout/summary/components/CheckoutCaptions.d.ts +11 -0
- package/dist/src/components/checkout/summary/components/GraduatedPriceBreakdown.d.ts +6 -0
- package/dist/src/components/checkout/summary/components/LineItems.d.ts +37 -0
- package/dist/src/components/checkout/summary/components/WithSkeleton.d.ts +6 -0
- package/dist/src/components/checkout/summary/components/getPriceBreakdownString.d.ts +15 -0
- package/dist/src/components/checkout/summary/index.d.ts +2 -0
- package/dist/src/components/checkout/types.d.ts +86 -0
- package/dist/src/components/common/CollapsableSectionIcon.d.ts +6 -0
- package/dist/src/components/common/Icon.d.ts +14 -0
- package/dist/src/components/common/InformationTooltip.d.ts +11 -0
- package/dist/src/components/common/LongText.d.ts +17 -0
- package/dist/src/components/common/PoweredByStigg.d.ts +12 -0
- package/dist/src/components/common/ProgressBar.d.ts +6 -0
- package/dist/src/components/common/StatusChip.d.ts +16 -0
- package/dist/src/components/common/TiersSelectContainer.d.ts +12 -0
- package/dist/src/components/common/Typography.d.ts +15 -0
- package/dist/src/components/common/VolumeBulkSelect.d.ts +5 -0
- package/dist/src/components/common/VolumePerUnitInput.d.ts +5 -0
- package/dist/src/components/common/chart/chartjs.helpers.d.ts +2 -0
- package/dist/src/components/common/chart/chartjs.plugins.d.ts +1 -0
- package/dist/src/components/common/chart/chartjs.theme.d.ts +23 -0
- package/dist/src/components/common/chart/chartjs.tooltip.plugin.d.ts +38 -0
- package/dist/src/components/common/customIcons.d.ts +24 -0
- package/dist/src/components/common/iconColor.d.ts +4 -0
- package/dist/src/components/common/mapExternalTheme.d.ts +7 -0
- package/dist/src/components/common/mediaQuery.d.ts +12 -0
- package/dist/src/components/common/table/DataRows.d.ts +9 -0
- package/dist/src/components/common/table/EmptyState.d.ts +7 -0
- package/dist/src/components/common/table/ErrorState.d.ts +7 -0
- package/dist/src/components/common/table/GenericTable.d.ts +25 -0
- package/dist/src/components/common/table/LoadingRows.d.ts +8 -0
- package/dist/src/components/common/table/index.d.ts +6 -0
- package/dist/src/components/common/table/types.d.ts +31 -0
- package/dist/src/components/credits/balance/CreditBalance.d.ts +11 -0
- package/dist/src/components/credits/balance/CreditBalanceValue.d.ts +7 -0
- package/dist/src/components/credits/creditUsageChart/CreditUsage.chartjs.d.ts +12 -0
- package/dist/src/components/credits/creditUsageChart/CreditUsageChart.d.ts +8 -0
- package/dist/src/components/credits/creditUsageChart/CreditUsageChartEmptyState.d.ts +2 -0
- package/dist/src/components/credits/creditUsageChart/CreditUsageChartErrorState.d.ts +2 -0
- package/dist/src/components/credits/creditUsageChart/CreditUsageChartHeader.d.ts +12 -0
- package/dist/src/components/credits/creditUsageChart/CreditUsageChartTooltip.d.ts +19 -0
- package/dist/src/components/credits/creditUsageChart/CreditUsageLegend.d.ts +6 -0
- package/dist/src/components/credits/creditUsageChart/types.d.ts +4 -0
- package/dist/src/components/credits/grants/CreditGrants.d.ts +6 -0
- package/dist/src/components/credits/grants/CreditGrantsTable.d.ts +14 -0
- package/dist/src/components/credits/grants/types.d.ts +23 -0
- package/dist/src/components/credits/grants/utils.d.ts +5 -0
- package/dist/src/components/credits/hooks/useCreditBalance.d.ts +32 -0
- package/dist/src/components/credits/hooks/useCreditGrants.d.ts +9 -0
- package/dist/src/components/credits/hooks/useCreditUsage.d.ts +13 -0
- package/dist/src/components/credits/index.d.ts +12 -0
- package/dist/src/components/credits/localization.d.ts +22 -0
- package/dist/src/components/credits/utilization/CreditUtilization.d.ts +12 -0
- package/dist/src/components/credits/utilization/CreditUtilizationValue.d.ts +9 -0
- package/dist/src/components/credits/utils/creditBalanceUtils.d.ts +11 -0
- package/dist/src/components/credits/utils/creditGrantUtils.d.ts +3 -0
- package/dist/src/components/customerPortal/CustomerPortal.d.ts +20 -0
- package/dist/src/components/customerPortal/CustomerPortal.style.d.ts +9 -0
- package/dist/src/components/customerPortal/CustomerPortalContainer.d.ts +6 -0
- package/dist/src/components/customerPortal/CustomerPortalContext.d.ts +16 -0
- package/dist/src/components/customerPortal/CustomerPortalHeader.d.ts +4 -0
- package/dist/src/components/customerPortal/CustomerPortalProvider.d.ts +11 -0
- package/dist/src/components/customerPortal/billing/InformationGrid.d.ts +16 -0
- package/dist/src/components/customerPortal/billing/InvoicesSection.d.ts +2 -0
- package/dist/src/components/customerPortal/billing/PaymentDetailsSection.d.ts +3 -0
- package/dist/src/components/customerPortal/common/ExternalLinkButton.d.ts +7 -0
- package/dist/src/components/customerPortal/common/SectionContainer.d.ts +8 -0
- package/dist/src/components/customerPortal/common/SectionHeader.d.ts +7 -0
- package/dist/src/components/customerPortal/common/SectionTitle.d.ts +7 -0
- package/dist/src/components/customerPortal/common/SkeletonButton.d.ts +2 -0
- package/dist/src/components/customerPortal/common/StyledButton.d.ts +6 -0
- package/dist/src/components/customerPortal/customerPortalTextOverrides.d.ts +17 -0
- package/dist/src/components/customerPortal/customerPortalTheme.d.ts +14 -0
- package/dist/src/components/customerPortal/hooks/useCustomerPortal.d.ts +11 -0
- package/dist/src/components/customerPortal/index.d.ts +16 -0
- package/dist/src/components/customerPortal/paywall/CustomerPortalPaywall.d.ts +10 -0
- package/dist/src/components/customerPortal/paywall/CustomerPortalPaywall.style.d.ts +13 -0
- package/dist/src/components/customerPortal/subscriptionOverview/ContactCustomerSupport.d.ts +8 -0
- package/dist/src/components/customerPortal/subscriptionOverview/SubscriptionOverviewLoader.d.ts +2 -0
- package/dist/src/components/customerPortal/subscriptionOverview/SubscriptionsOverview.d.ts +13 -0
- package/dist/src/components/customerPortal/subscriptionOverview/SubscriptionsOverviewHeader.d.ts +9 -0
- package/dist/src/components/customerPortal/subscriptionOverview/charges/ChargeItem.d.ts +17 -0
- package/dist/src/components/customerPortal/subscriptionOverview/charges/ChargeList.d.ts +12 -0
- package/dist/src/components/customerPortal/subscriptionOverview/subscriptionScheduledUpdates/SubscriptionScheduledUpdateRow.d.ts +8 -0
- package/dist/src/components/customerPortal/subscriptionOverview/subscriptionScheduledUpdates/SubscriptionScheduledUpdatesAlert.d.ts +9 -0
- package/dist/src/components/customerPortal/subscriptionOverview/subscriptionView/SubscriptionView.d.ts +11 -0
- package/dist/src/components/customerPortal/subscriptionOverview/subscriptionView/SubscriptionView.style.d.ts +5 -0
- package/dist/src/components/customerPortal/subscriptionOverview/subscriptionView/TrialPanel.d.ts +7 -0
- package/dist/src/components/customerPortal/subscriptionOverview/tabs/AddonsList.d.ts +2 -0
- package/dist/src/components/customerPortal/subscriptionOverview/tabs/Promotions.d.ts +2 -0
- package/dist/src/components/customerPortal/subscriptionOverview/tabs/SubscriptionTabs.d.ts +11 -0
- package/dist/src/components/customerPortal/subscriptionOverview/tabs/SubscriptionTabs.style.d.ts +24 -0
- package/dist/src/components/customerPortal/subscriptionOverview/types/customerPortal.types.d.ts +3 -0
- package/dist/src/components/customerPortal/subscriptionOverview/upcomingBilling/NextEstimatedBill.d.ts +8 -0
- package/dist/src/components/customerPortal/subscriptionOverview/upcomingBilling/NoUpcomingBilling.d.ts +6 -0
- package/dist/src/components/customerPortal/subscriptionOverview/upcomingBilling/UpcomingBilling.d.ts +10 -0
- package/dist/src/components/customerPortal/types.d.ts +13 -0
- package/dist/src/components/customerPortal/usage/CustomerUsageData.d.ts +8 -0
- package/dist/src/components/customerPortal/usage/CustomerUsageData.style.d.ts +6 -0
- package/dist/src/components/customerPortal/usage/featureUsage/EntitlementCTAButton.d.ts +14 -0
- package/dist/src/components/customerPortal/usage/featureUsage/FeatureUsage.d.ts +13 -0
- package/dist/src/components/customerPortal/usage/featureUsage/FeatureUsage.helper.d.ts +5 -0
- package/dist/src/components/customerPortal/usage/featureUsage/FeatureUsage.style.d.ts +8 -0
- package/dist/src/components/customerPortal/usage/featureUsage/FeatureUsageProgressBar.d.ts +15 -0
- package/dist/src/components/guards/BooleanEntitlementGuard.d.ts +7 -0
- package/dist/src/components/guards/EnumEntitlementGuard.d.ts +7 -0
- package/dist/src/components/guards/MeteredEntitlementGuard.d.ts +7 -0
- package/dist/src/components/guards/NumericEntitlementGuard.d.ts +7 -0
- package/dist/src/components/hooks/index.d.ts +1 -0
- package/dist/src/components/hooks/useChargeSort.d.ts +3 -0
- package/dist/src/components/hooks/useIsScreenWiderThan.d.ts +2 -0
- package/dist/src/components/hooks/usePagination.d.ts +6 -0
- package/dist/src/components/hooks/useWaitForCheckoutCompleted.d.ts +14 -0
- package/dist/src/components/paywall/BillingPeriodPicker.d.ts +7 -0
- package/dist/src/components/paywall/EntitlementRow.d.ts +20 -0
- package/dist/src/components/paywall/Paywall.d.ts +23 -0
- package/dist/src/components/paywall/PaywallContainer.d.ts +20 -0
- package/dist/src/components/paywall/PaywallLoader.d.ts +2 -0
- package/dist/src/components/paywall/PlanCompatibleAddons.d.ts +13 -0
- package/dist/src/components/paywall/PlanEntitlements.d.ts +8 -0
- package/dist/src/components/paywall/PlanOffering.d.ts +27 -0
- package/dist/src/components/paywall/PlanOfferingButton.d.ts +18 -0
- package/dist/src/components/paywall/PlanPrice.d.ts +17 -0
- package/dist/src/components/paywall/hooks/useLoadPaywallData.d.ts +12 -0
- package/dist/src/components/paywall/index.d.ts +5 -0
- package/dist/src/components/paywall/paywallTextOverrides.d.ts +81 -0
- package/dist/src/components/paywall/types.d.ts +58 -0
- package/dist/src/components/paywall/utils/calculateTrialDaysLeft.d.ts +1 -0
- package/dist/src/components/paywall/utils/calculateUnitQuantityText.d.ts +1 -0
- package/dist/src/components/paywall/utils/computeDefaultBillingPeriod.d.ts +5 -0
- package/dist/src/components/paywall/utils/getPlansToDisplay.d.ts +3 -0
- package/dist/src/components/paywall/utils/hasPricePoints.d.ts +4 -0
- package/dist/src/components/paywall/utils/mapPaywallData.d.ts +14 -0
- package/dist/src/components/utils/calculateDiscountRate.d.ts +3 -0
- package/dist/src/components/utils/currencyUtils.d.ts +9 -0
- package/dist/src/components/utils/dateUtils.d.ts +10 -0
- package/dist/src/components/utils/fixtures/price.fixtures.d.ts +7 -0
- package/dist/src/components/utils/formatNumber.d.ts +1 -0
- package/dist/src/components/utils/getFeatureName.d.ts +3 -0
- package/dist/src/components/utils/getPaidPriceText.d.ts +14 -0
- package/dist/src/components/utils/getPlanPrice.d.ts +9 -0
- package/dist/src/components/utils/getSubscriptionScheduleUpdateTexts.d.ts +22 -0
- package/dist/src/components/utils/numberUtils.d.ts +4 -0
- package/dist/src/components/utils/onWheelBlur.d.ts +2 -0
- package/dist/src/components/utils/planPrices.d.ts +4 -0
- package/dist/src/components/utils/priceTierUtils.d.ts +34 -0
- package/dist/src/components/utils/priceUtils.d.ts +2 -0
- package/dist/src/hooks/index.d.ts +8 -0
- package/dist/src/hooks/useActiveSubscriptions.d.ts +6 -0
- package/dist/src/hooks/useBooleanEntitlement.d.ts +5 -0
- package/dist/src/hooks/useCustomerPortal.d.ts +6 -0
- package/dist/src/hooks/useEnumEntitlement.d.ts +6 -0
- package/dist/src/hooks/useFetch.d.ts +8 -0
- package/dist/src/hooks/useMeteredEntitlement.d.ts +6 -0
- package/dist/src/hooks/useNumericEntitlement.d.ts +6 -0
- package/dist/src/hooks/usePaywall.d.ts +6 -0
- package/dist/src/hooks/useStiggContext.d.ts +7 -0
- package/dist/src/index.d.ts +26 -0
- package/dist/src/services/logger.d.ts +12 -0
- package/dist/src/stories/CustomTheme.d.ts +2 -0
- package/dist/src/stories/baseArgs.d.ts +11 -0
- package/dist/src/stories/mocks/checkout/consts.d.ts +11 -0
- package/dist/src/stories/mocks/checkout/mockCheckoutPreview.d.ts +2 -0
- package/dist/src/stories/mocks/checkout/mockCheckoutState.d.ts +2 -0
- package/dist/src/theme/Fonts.d.ts +3 -0
- package/dist/src/theme/Theme.d.ts +10 -0
- package/dist/src/theme/getResolvedTheme.d.ts +4 -0
- package/dist/src/theme/types.d.ts +83 -0
- package/dist/src/types.d.ts +16 -0
- package/dist/src/utils/styledUtils.d.ts +2 -0
- package/dist/stripe.esm-BkoVJ3BR.js +67 -0
- package/dist/stripe.esm-BkoVJ3BR.js.map +1 -0
- package/dist/stripe.esm-XRG9pJRV.cjs +2 -0
- package/dist/stripe.esm-XRG9pJRV.cjs.map +1 -0
- package/package.json +15 -3
- package/src/assets/add.svg +3 -0
- package/src/assets/addons.svg +12 -0
- package/src/assets/arrow-forward.svg +3 -0
- package/src/assets/arrow-right.svg +6 -0
- package/src/assets/billing-info-customer.svg +11 -0
- package/src/assets/check-stigg.svg +3 -0
- package/src/assets/check.svg +5 -0
- package/src/assets/close.svg +3 -0
- package/src/assets/contact-support.svg +13 -0
- package/src/assets/coupon.svg +6 -0
- package/src/assets/credit-card.svg +10 -0
- package/src/assets/dollar-coin.svg +13 -0
- package/src/assets/edit-icon.svg +3 -0
- package/src/assets/entitlement-check.svg +3 -0
- package/src/assets/lottie/checkout-success.json +1 -0
- package/src/assets/mini-schedule.svg +3 -0
- package/src/assets/outlined-checked-circle-disabled.svg +6 -0
- package/src/assets/outlined-checked-circle.svg +6 -0
- package/src/assets/outlined-circle.svg +3 -0
- package/src/assets/pay-as-you-go-charge.svg +11 -0
- package/src/assets/payment-method.svg +4 -0
- package/src/assets/plus-icon.svg +6 -0
- package/src/assets/powered-by-stigg.svg +13 -0
- package/src/assets/promotions.svg +13 -0
- package/src/assets/remove.svg +3 -0
- package/src/assets/restore.svg +3 -0
- package/src/assets/sand-clock.svg +4 -0
- package/src/assets/schedule-box.svg +9 -0
- package/src/assets/schedule.svg +3 -0
- package/src/assets/subscription-renews-icon.svg +14 -0
- package/src/assets/trash.svg +8 -0
- package/src/components/StiggProvider.tsx +170 -0
- package/src/components/checkout/Checkout.tsx +37 -0
- package/src/components/checkout/CheckoutContainer.style.ts +51 -0
- package/src/components/checkout/CheckoutContainer.tsx +193 -0
- package/src/components/checkout/CheckoutProvider.tsx +181 -0
- package/src/components/checkout/components/Button.tsx +35 -0
- package/src/components/checkout/components/ChangePlanButton.tsx +30 -0
- package/src/components/checkout/components/ContentLoadingSkeleton.tsx +41 -0
- package/src/components/checkout/components/DowngradeToFreeContainer.tsx +115 -0
- package/src/components/checkout/components/InputField.tsx +26 -0
- package/src/components/checkout/components/Skeletons.style.ts +30 -0
- package/src/components/checkout/components/StyledArrow.tsx +9 -0
- package/src/components/checkout/components/index.ts +3 -0
- package/src/components/checkout/configurations/steps.ts +1 -0
- package/src/components/checkout/configurations/textOverrides.ts +150 -0
- package/src/components/checkout/configurations/theme.ts +46 -0
- package/src/components/checkout/configurations/typography.ts +30 -0
- package/src/components/checkout/formatting.ts +12 -0
- package/src/components/checkout/hooks/index.ts +8 -0
- package/src/components/checkout/hooks/useAddonsStepModel.ts +92 -0
- package/src/components/checkout/hooks/useCheckoutModel.ts +53 -0
- package/src/components/checkout/hooks/useCouponModel.ts +28 -0
- package/src/components/checkout/hooks/useLoadCheckout.ts +48 -0
- package/src/components/checkout/hooks/usePaymentStepModel.ts +68 -0
- package/src/components/checkout/hooks/usePlanStepModel.ts +184 -0
- package/src/components/checkout/hooks/usePreviewSubscription.ts +165 -0
- package/src/components/checkout/hooks/useProgressBarModel.ts +211 -0
- package/src/components/checkout/hooks/useSubscriptionModel.ts +22 -0
- package/src/components/checkout/hooks/useSubscriptionState.ts +26 -0
- package/src/components/checkout/index.ts +8 -0
- package/src/components/checkout/planHeader/PlanHeader.tsx +41 -0
- package/src/components/checkout/planHeader/index.ts +1 -0
- package/src/components/checkout/progressBar/CheckoutProgressBar.style.ts +35 -0
- package/src/components/checkout/progressBar/CheckoutProgressBar.tsx +82 -0
- package/src/components/checkout/promotionCode/AddPromotionCode.tsx +107 -0
- package/src/components/checkout/promotionCode/AddPromotionCodeButton.tsx +43 -0
- package/src/components/checkout/promotionCode/AppliedPromotionCode.tsx +49 -0
- package/src/components/checkout/promotionCode/PromotionCodeSection.tsx +40 -0
- package/src/components/checkout/promotionCode/index.ts +1 -0
- package/src/components/checkout/steps/addons/CheckoutAddonsStep.style.tsx +34 -0
- package/src/components/checkout/steps/addons/CheckoutAddonsStep.tsx +144 -0
- package/src/components/checkout/steps/addons/addon.utils.ts +67 -0
- package/src/components/checkout/steps/addons/components/AddonInputContainer.tsx +84 -0
- package/src/components/checkout/steps/addons/components/AddonTextContainer.tsx +45 -0
- package/src/components/checkout/steps/addons/index.ts +1 -0
- package/src/components/checkout/steps/payment/PaymentMethods.style.ts +36 -0
- package/src/components/checkout/steps/payment/PaymentMethods.tsx +106 -0
- package/src/components/checkout/steps/payment/PaymentStep.tsx +63 -0
- package/src/components/checkout/steps/payment/index.ts +1 -0
- package/src/components/checkout/steps/payment/stripe/StripePaymentForm.tsx +79 -0
- package/src/components/checkout/steps/payment/stripe/index.ts +3 -0
- package/src/components/checkout/steps/payment/stripe/stripe.utils.ts +122 -0
- package/src/components/checkout/steps/payment/stripe/useStripeIntegration.ts +33 -0
- package/src/components/checkout/steps/payment/stripe/useSubmit.ts +135 -0
- package/src/components/checkout/steps/payment/zuora/ZuoraPaymentForm.tsx +128 -0
- package/src/components/checkout/steps/payment/zuora/index.ts +9 -0
- package/src/components/checkout/steps/payment/zuora/useZuoraIntegration.ts +56 -0
- package/src/components/checkout/steps/payment/zuora/useZuoraSubmit.ts +125 -0
- package/src/components/checkout/steps/payment/zuora/zuora.utils.ts +72 -0
- package/src/components/checkout/steps/plan/BillingPeriodPicker.style.tsx +69 -0
- package/src/components/checkout/steps/plan/BillingPeriodPicker.tsx +86 -0
- package/src/components/checkout/steps/plan/CheckoutChargeList.tsx +223 -0
- package/src/components/checkout/steps/plan/CheckoutPlanStep.style.tsx +6 -0
- package/src/components/checkout/steps/plan/CheckoutPlanStep.tsx +31 -0
- package/src/components/checkout/steps/plan/index.ts +1 -0
- package/src/components/checkout/summary/CheckoutSuccess.tsx +82 -0
- package/src/components/checkout/summary/CheckoutSummary.tsx +458 -0
- package/src/components/checkout/summary/CheckoutSummarySkeleton.tsx +38 -0
- package/src/components/checkout/summary/components/CheckoutCaptions.tsx +145 -0
- package/src/components/checkout/summary/components/GraduatedPriceBreakdown.tsx +70 -0
- package/src/components/checkout/summary/components/LineItems.tsx +275 -0
- package/src/components/checkout/summary/components/WithSkeleton.tsx +16 -0
- package/src/components/checkout/summary/components/getPriceBreakdownString.ts +66 -0
- package/src/components/checkout/summary/index.ts +2 -0
- package/src/components/checkout/types.ts +82 -0
- package/src/components/common/CollapsableSectionIcon.tsx +9 -0
- package/src/components/common/Icon.tsx +61 -0
- package/src/components/common/InformationTooltip.tsx +28 -0
- package/src/components/common/LongText.tsx +100 -0
- package/src/components/common/PoweredByStigg.tsx +59 -0
- package/src/components/common/ProgressBar.tsx +41 -0
- package/src/components/common/StatusChip.tsx +29 -0
- package/src/components/common/TiersSelectContainer.tsx +39 -0
- package/src/components/common/Typography.tsx +117 -0
- package/src/components/common/VolumeBulkSelect.tsx +74 -0
- package/src/components/common/VolumePerUnitInput.tsx +42 -0
- package/src/components/common/chart/chartjs.helpers.ts +17 -0
- package/src/components/common/chart/chartjs.plugins.ts +34 -0
- package/src/components/common/chart/chartjs.theme.ts +41 -0
- package/src/components/common/chart/chartjs.tooltip.plugin.tsx +224 -0
- package/src/components/common/customIcons.ts +24 -0
- package/src/components/common/iconColor.ts +15 -0
- package/src/components/common/mapExternalTheme.ts +147 -0
- package/src/components/common/mediaQuery.ts +19 -0
- package/src/components/common/table/DataRows.tsx +33 -0
- package/src/components/common/table/EmptyState.tsx +19 -0
- package/src/components/common/table/ErrorState.tsx +19 -0
- package/src/components/common/table/GenericTable.tsx +199 -0
- package/src/components/common/table/LoadingRows.tsx +33 -0
- package/src/components/common/table/index.ts +6 -0
- package/src/components/common/table/types.ts +34 -0
- package/src/components/credits/balance/CreditBalance.tsx +70 -0
- package/src/components/credits/balance/CreditBalanceValue.tsx +60 -0
- package/src/components/credits/creditUsageChart/CreditUsage.chartjs.ts +223 -0
- package/src/components/credits/creditUsageChart/CreditUsageChart.tsx +128 -0
- package/src/components/credits/creditUsageChart/CreditUsageChartEmptyState.tsx +29 -0
- package/src/components/credits/creditUsageChart/CreditUsageChartErrorState.tsx +19 -0
- package/src/components/credits/creditUsageChart/CreditUsageChartHeader.tsx +104 -0
- package/src/components/credits/creditUsageChart/CreditUsageChartTooltip.tsx +93 -0
- package/src/components/credits/creditUsageChart/CreditUsageLegend.tsx +141 -0
- package/src/components/credits/creditUsageChart/types.ts +4 -0
- package/src/components/credits/grants/CreditGrants.tsx +84 -0
- package/src/components/credits/grants/CreditGrantsTable.tsx +113 -0
- package/src/components/credits/grants/types.ts +40 -0
- package/src/components/credits/grants/utils.ts +25 -0
- package/src/components/credits/hooks/useCreditBalance.ts +75 -0
- package/src/components/credits/hooks/useCreditGrants.ts +45 -0
- package/src/components/credits/hooks/useCreditUsage.ts +50 -0
- package/src/components/credits/index.ts +15 -0
- package/src/components/credits/localization.ts +25 -0
- package/src/components/credits/utilization/CreditUtilization.tsx +74 -0
- package/src/components/credits/utilization/CreditUtilizationValue.tsx +113 -0
- package/src/components/credits/utils/creditBalanceUtils.ts +31 -0
- package/src/components/credits/utils/creditGrantUtils.ts +27 -0
- package/src/components/customerPortal/CustomerPortal.style.ts +20 -0
- package/src/components/customerPortal/CustomerPortal.tsx +37 -0
- package/src/components/customerPortal/CustomerPortalContainer.tsx +77 -0
- package/src/components/customerPortal/CustomerPortalContext.ts +32 -0
- package/src/components/customerPortal/CustomerPortalHeader.tsx +18 -0
- package/src/components/customerPortal/CustomerPortalProvider.tsx +49 -0
- package/src/components/customerPortal/billing/InformationGrid.tsx +54 -0
- package/src/components/customerPortal/billing/InvoicesSection.tsx +41 -0
- package/src/components/customerPortal/billing/PaymentDetailsSection.tsx +140 -0
- package/src/components/customerPortal/common/ExternalLinkButton.tsx +34 -0
- package/src/components/customerPortal/common/SectionContainer.tsx +22 -0
- package/src/components/customerPortal/common/SectionHeader.ts +15 -0
- package/src/components/customerPortal/common/SectionTitle.tsx +23 -0
- package/src/components/customerPortal/common/SkeletonButton.tsx +5 -0
- package/src/components/customerPortal/common/StyledButton.tsx +13 -0
- package/src/components/customerPortal/customerPortalTextOverrides.ts +39 -0
- package/src/components/customerPortal/customerPortalTheme.ts +35 -0
- package/src/components/customerPortal/hooks/useCustomerPortal.ts +39 -0
- package/src/components/customerPortal/index.ts +16 -0
- package/src/components/customerPortal/paywall/CustomerPortalPaywall.style.ts +33 -0
- package/src/components/customerPortal/paywall/CustomerPortalPaywall.tsx +36 -0
- package/src/components/customerPortal/subscriptionOverview/ContactCustomerSupport.tsx +50 -0
- package/src/components/customerPortal/subscriptionOverview/SubscriptionOverviewLoader.tsx +28 -0
- package/src/components/customerPortal/subscriptionOverview/SubscriptionsOverview.tsx +106 -0
- package/src/components/customerPortal/subscriptionOverview/SubscriptionsOverviewHeader.tsx +48 -0
- package/src/components/customerPortal/subscriptionOverview/charges/ChargeItem.tsx +74 -0
- package/src/components/customerPortal/subscriptionOverview/charges/ChargeList.tsx +65 -0
- package/src/components/customerPortal/subscriptionOverview/subscriptionScheduledUpdates/SubscriptionScheduledUpdateRow.tsx +110 -0
- package/src/components/customerPortal/subscriptionOverview/subscriptionScheduledUpdates/SubscriptionScheduledUpdatesAlert.tsx +158 -0
- package/src/components/customerPortal/subscriptionOverview/subscriptionView/SubscriptionView.style.ts +6 -0
- package/src/components/customerPortal/subscriptionOverview/subscriptionView/SubscriptionView.tsx +37 -0
- package/src/components/customerPortal/subscriptionOverview/subscriptionView/TrialPanel.tsx +58 -0
- package/src/components/customerPortal/subscriptionOverview/tabs/AddonsList.tsx +28 -0
- package/src/components/customerPortal/subscriptionOverview/tabs/Promotions.tsx +62 -0
- package/src/components/customerPortal/subscriptionOverview/tabs/SubscriptionTabs.style.tsx +32 -0
- package/src/components/customerPortal/subscriptionOverview/tabs/SubscriptionTabs.tsx +100 -0
- package/src/components/customerPortal/subscriptionOverview/types/customerPortal.types.ts +4 -0
- package/src/components/customerPortal/subscriptionOverview/upcomingBilling/NextEstimatedBill.tsx +29 -0
- package/src/components/customerPortal/subscriptionOverview/upcomingBilling/NoUpcomingBilling.tsx +18 -0
- package/src/components/customerPortal/subscriptionOverview/upcomingBilling/UpcomingBilling.tsx +89 -0
- package/src/components/customerPortal/types.ts +20 -0
- package/src/components/customerPortal/usage/CustomerUsageData.style.tsx +22 -0
- package/src/components/customerPortal/usage/CustomerUsageData.tsx +124 -0
- package/src/components/customerPortal/usage/featureUsage/EntitlementCTAButton.tsx +62 -0
- package/src/components/customerPortal/usage/featureUsage/FeatureUsage.helper.ts +45 -0
- package/src/components/customerPortal/usage/featureUsage/FeatureUsage.style.ts +13 -0
- package/src/components/customerPortal/usage/featureUsage/FeatureUsage.tsx +96 -0
- package/src/components/customerPortal/usage/featureUsage/FeatureUsageProgressBar.tsx +56 -0
- package/src/components/guards/BooleanEntitlementGuard.tsx +21 -0
- package/src/components/guards/EnumEntitlementGuard.tsx +17 -0
- package/src/components/guards/MeteredEntitlementGuard.tsx +21 -0
- package/src/components/guards/NumericEntitlementGuard.tsx +21 -0
- package/src/components/hooks/index.ts +1 -0
- package/src/components/hooks/useChargeSort.ts +17 -0
- package/src/components/hooks/useIsScreenWiderThan.ts +6 -0
- package/src/components/hooks/usePagination.ts +33 -0
- package/src/components/hooks/useWaitForCheckoutCompleted.ts +65 -0
- package/src/components/paywall/BillingPeriodPicker.tsx +90 -0
- package/src/components/paywall/EntitlementRow.tsx +127 -0
- package/src/components/paywall/Paywall.tsx +189 -0
- package/src/components/paywall/PaywallContainer.tsx +119 -0
- package/src/components/paywall/PaywallLoader.tsx +96 -0
- package/src/components/paywall/PlanCompatibleAddons.tsx +127 -0
- package/src/components/paywall/PlanEntitlements.tsx +75 -0
- package/src/components/paywall/PlanOffering.tsx +256 -0
- package/src/components/paywall/PlanOfferingButton.tsx +232 -0
- package/src/components/paywall/PlanPrice.tsx +154 -0
- package/src/components/paywall/hooks/useLoadPaywallData.ts +75 -0
- package/src/components/paywall/index.ts +5 -0
- package/src/components/paywall/paywallTextOverrides.ts +79 -0
- package/src/components/paywall/types.ts +80 -0
- package/src/components/paywall/utils/calculateTrialDaysLeft.ts +5 -0
- package/src/components/paywall/utils/calculateUnitQuantityText.ts +23 -0
- package/src/components/paywall/utils/computeDefaultBillingPeriod.ts +36 -0
- package/src/components/paywall/utils/getPlansToDisplay.ts +13 -0
- package/src/components/paywall/utils/hasPricePoints.ts +10 -0
- package/src/components/paywall/utils/mapPaywallData.ts +126 -0
- package/src/components/utils/calculateDiscountRate.ts +49 -0
- package/src/components/utils/currencyUtils.ts +38 -0
- package/src/components/utils/dateUtils.ts +17 -0
- package/src/components/utils/fixtures/price.fixtures.ts +42 -0
- package/src/components/utils/formatNumber.ts +5 -0
- package/src/components/utils/getFeatureName.ts +26 -0
- package/src/components/utils/getPaidPriceText.ts +77 -0
- package/src/components/utils/getPlanPrice.ts +62 -0
- package/src/components/utils/getSubscriptionScheduleUpdateTexts.tsx +88 -0
- package/src/components/utils/numberUtils.ts +6 -0
- package/src/components/utils/onWheelBlur.ts +3 -0
- package/src/components/utils/planPrices.ts +10 -0
- package/src/components/utils/priceTierUtils.spec.ts +84 -0
- package/src/components/utils/priceTierUtils.ts +250 -0
- package/src/components/utils/priceUtils.ts +11 -0
- package/src/custom.d.ts +6 -0
- package/src/hooks/index.ts +8 -0
- package/src/hooks/useActiveSubscriptions.ts +21 -0
- package/src/hooks/useBooleanEntitlement.ts +20 -0
- package/src/hooks/useCustomerPortal.ts +21 -0
- package/src/hooks/useEnumEntitlement.ts +20 -0
- package/src/hooks/useFetch.ts +32 -0
- package/src/hooks/useMeteredEntitlement.ts +20 -0
- package/src/hooks/useNumericEntitlement.ts +20 -0
- package/src/hooks/usePaywall.ts +21 -0
- package/src/hooks/useStiggContext.ts +13 -0
- package/src/index.ts +103 -0
- package/src/services/logger.ts +22 -0
- package/src/stories/Checkout.stories.tsx +123 -0
- package/src/stories/CreditBalance.stories.tsx +248 -0
- package/src/stories/CreditGrants.stories.tsx +214 -0
- package/src/stories/CreditUsageChart.stories.tsx +347 -0
- package/src/stories/CreditUtilization.stories.tsx +287 -0
- package/src/stories/CustomTheme.ts +57 -0
- package/src/stories/CustomerPortal.stories.tsx +265 -0
- package/src/stories/GenericTable.stories.tsx +263 -0
- package/src/stories/Paywall.stories.tsx +147 -0
- package/src/stories/ProgressBar.stories.tsx +103 -0
- package/src/stories/StatusChip.stories.tsx +154 -0
- package/src/stories/baseArgs.ts +10 -0
- package/src/stories/mocks/checkout/consts.ts +15 -0
- package/src/stories/mocks/checkout/mockCheckoutPreview.ts +152 -0
- package/src/stories/mocks/checkout/mockCheckoutState.ts +212 -0
- package/src/styles.css +46 -0
- package/src/theme/Fonts.tsx +80 -0
- package/src/theme/Theme.tsx +64 -0
- package/src/theme/emotion.d.ts +17 -0
- package/src/theme/getResolvedTheme.ts +135 -0
- package/src/theme/types.ts +85 -0
- package/src/types.ts +22 -0
- package/src/utils/styledUtils.ts +64 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { BillingPeriod, Price, PriceTierFragment, Subscription } from '@stigg/js-client-sdk';
|
|
2
|
+
import { PaywallPlan } from '../paywall';
|
|
3
|
+
import { CurrentSubscriptionOverride, SelectDefaultTierIndexFn } from '../paywall/types';
|
|
4
|
+
export declare function getPriceFeatureUnit(price: Price): string;
|
|
5
|
+
export declare function getTierByQuantity(tiers: PriceTierFragment[], quantity: number): PriceTierFragment;
|
|
6
|
+
export declare function calculateTierPriceGraduated(tiers: PriceTierFragment[], unitQuantity: number, selectedBillingPeriod?: BillingPeriod, shouldShowMonthlyPriceAmount?: boolean): {
|
|
7
|
+
total: number;
|
|
8
|
+
breakdown: Array<{
|
|
9
|
+
unitQuantity: number;
|
|
10
|
+
amount: number;
|
|
11
|
+
}>;
|
|
12
|
+
};
|
|
13
|
+
export declare function calculateTierPrice(price: Pick<Price, 'tiers' | 'tiersMode'>, unitQuantity: number, selectedBillingPeriod?: BillingPeriod, shouldShowMonthlyPriceAmount?: boolean): number;
|
|
14
|
+
export declare function hasTierWithUnitPrice(tiers: PriceTierFragment[] | null | undefined): boolean | undefined;
|
|
15
|
+
export declare function isBulkTiers(tiers: PriceTierFragment[] | null | undefined): boolean | undefined;
|
|
16
|
+
export declare function isQuantityInFirstTier(tiers: PriceTierFragment[] | null | undefined, quantity: number): boolean | 0 | null | undefined;
|
|
17
|
+
export declare function getTiersPerUnitQuantities({ plan, billingPeriod, currentSubscription, currentSubscriptionOverride, selectDefaultTierIndex, }: {
|
|
18
|
+
plan: PaywallPlan;
|
|
19
|
+
billingPeriod: BillingPeriod;
|
|
20
|
+
currentSubscription: Subscription | null;
|
|
21
|
+
currentSubscriptionOverride?: CurrentSubscriptionOverride | null;
|
|
22
|
+
selectDefaultTierIndex?: SelectDefaultTierIndexFn;
|
|
23
|
+
}): Record<string, number>;
|
|
24
|
+
export declare enum PriceTierComparison {
|
|
25
|
+
Lower = -1,
|
|
26
|
+
Equal = 0,
|
|
27
|
+
Higher = 1
|
|
28
|
+
}
|
|
29
|
+
export declare function compareSelectedTierToCurrentTier({ perUnitQuantityByFeature, plan, currentSubscription, currentSubscriptionOverride, }: {
|
|
30
|
+
perUnitQuantityByFeature: Record<string, number>;
|
|
31
|
+
plan: PaywallPlan;
|
|
32
|
+
currentSubscription: Subscription | null;
|
|
33
|
+
currentSubscriptionOverride?: CurrentSubscriptionOverride | null;
|
|
34
|
+
}): PriceTierComparison;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { useBooleanEntitlement } from './useBooleanEntitlement';
|
|
2
|
+
export { useNumericEntitlement } from './useNumericEntitlement';
|
|
3
|
+
export { useMeteredEntitlement } from './useMeteredEntitlement';
|
|
4
|
+
export { useEnumEntitlement } from './useEnumEntitlement';
|
|
5
|
+
export { useActiveSubscriptions } from './useActiveSubscriptions';
|
|
6
|
+
export { usePaywall } from './usePaywall';
|
|
7
|
+
export { useCustomerPortal } from './useCustomerPortal';
|
|
8
|
+
export { useStiggContext } from './useStiggContext';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { GetActiveSubscriptions } from '@stigg/js-client-sdk';
|
|
2
|
+
export declare function useActiveSubscriptions(params?: GetActiveSubscriptions): {
|
|
3
|
+
activeSubscriptions: import('@stigg/js-client-sdk').Subscription[] | null;
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
error: Error | null;
|
|
6
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BooleanEntitlement, GetBooleanEntitlement } from '@stigg/js-client-sdk';
|
|
2
|
+
export type TypedGetBooleanEntitlement<T> = Omit<GetBooleanEntitlement, 'featureId'> & {
|
|
3
|
+
featureId: T;
|
|
4
|
+
};
|
|
5
|
+
export declare function useBooleanEntitlement<T extends string>(params: TypedGetBooleanEntitlement<T>): BooleanEntitlement;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { GetEnumEntitlement, EnumEntitlement } from '@stigg/js-client-sdk';
|
|
2
|
+
type TypedGetEnumEntitlement<T> = Omit<GetEnumEntitlement, 'featureId'> & {
|
|
3
|
+
featureId: T;
|
|
4
|
+
};
|
|
5
|
+
export declare function useEnumEntitlement<T extends string>(params: TypedGetEnumEntitlement<T>): EnumEntitlement;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { GetMeteredEntitlement, MeteredEntitlement } from '@stigg/js-client-sdk';
|
|
2
|
+
type TypedGetMeteredEntitlement<T> = Omit<GetMeteredEntitlement, 'featureId'> & {
|
|
3
|
+
featureId: T;
|
|
4
|
+
};
|
|
5
|
+
export declare function useMeteredEntitlement<T extends string>(params: TypedGetMeteredEntitlement<T>): MeteredEntitlement;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { NumericEntitlement, GetNumericEntitlement } from '@stigg/js-client-sdk';
|
|
2
|
+
type TypedGetNumericEntitlement<T> = Omit<GetNumericEntitlement, 'featureId'> & {
|
|
3
|
+
featureId: T;
|
|
4
|
+
};
|
|
5
|
+
export declare function useNumericEntitlement<T extends string>(params: TypedGetNumericEntitlement<T>): NumericEntitlement;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export * from '@stigg/js-client-sdk';
|
|
2
|
+
export { Paywall } from './components/paywall';
|
|
3
|
+
export { SubscribeIntentionType } from './components/paywall';
|
|
4
|
+
export type { PaywallProps, OnPlanSelectedCallbackFn, CurrentSubscriptionOverride, CurrentSubscriptionOverrideFn, PaywallPlan, PaywallLocalization, PlanPriceText, CurrentPlanParams, PaywallData, SelectDefaultTierIndexFn, ShouldHidePlanFn, } from './components/paywall';
|
|
5
|
+
export { CustomerPortalProvider, CustomerPortal, AddonsList, PaymentDetailsSection, InvoicesSection, CustomerUsageData, SubscriptionsOverview, Promotions, } from './components/customerPortal';
|
|
6
|
+
export type { CustomerPortalProps, CustomerPortalSection, CustomerUsageDataProps, SubscriptionsOverviewProps, CustomerPortalIntentionType, OnBuyMoreCallbackFn, OnManageSubscriptionFn, CustomerPortalLocalization, CustomerPortalTheme, } from './components/customerPortal';
|
|
7
|
+
export { StiggProvider, StiggContext } from './components/StiggProvider';
|
|
8
|
+
export type { StiggProviderProps, StiggContextValue } from './components/StiggProvider';
|
|
9
|
+
export { Checkout } from './components/checkout';
|
|
10
|
+
export type { CheckoutProps, CheckoutProviderProps, CheckoutContainerProps, CheckoutLocalization, CheckoutResult, OnCheckoutCompletedParams, OnCheckoutParams, CheckoutTheme, CheckoutMockProps, MockCheckoutPreviewCallback, MockCheckoutStateCallback, BillingInformation, CheckoutStepKey, TaxDetailsInput, OnBeforeStepChangeCallback, OnBillableFeatureChangeCallback, OnAddonChangeCallback, CheckoutState, } from './components/checkout';
|
|
11
|
+
export { useWaitForCheckoutCompleted, ProvisionStatus } from './components/hooks';
|
|
12
|
+
export { useBooleanEntitlement, useMeteredEntitlement, useEnumEntitlement, useNumericEntitlement, useActiveSubscriptions, useCustomerPortal, useStiggContext, usePaywall, } from './hooks';
|
|
13
|
+
export type { HorizontalAlignment, TextAlignment, FontVariant, StiggTheme } from './theme/types';
|
|
14
|
+
export type { CustomizedTheme as Theme } from './theme/Theme';
|
|
15
|
+
export { BooleanEntitlementGuard } from './components/guards/BooleanEntitlementGuard';
|
|
16
|
+
export { NumericEntitlementGuard } from './components/guards/NumericEntitlementGuard';
|
|
17
|
+
export { MeteredEntitlementGuard } from './components/guards/MeteredEntitlementGuard';
|
|
18
|
+
export { EnumEntitlementGuard } from './components/guards/EnumEntitlementGuard';
|
|
19
|
+
export type { CreditBalanceProps, CreditUtilizationProps, CreditUtilizationLocalization, CreditGrantsProps, GetCreditGrantsParams, CreditGrantsLocalization, GetCreditBalanceParams, } from './components/credits';
|
|
20
|
+
export { CreditBalance, useCreditBalance, CreditUtilization, CreditGrants, useCreditGrants, CreditUsageChart, useCreditUsage, } from './components/credits';
|
|
21
|
+
export type { HeadCell, GenericTableProps, TableAlignment, PixelWidth } from './components/common/table';
|
|
22
|
+
export { GenericTable, ErrorState, EmptyState } from './components/common/table';
|
|
23
|
+
export { formatDateTime, formatDateOnly } from './components/utils/dateUtils';
|
|
24
|
+
export type { StatusChipVariant, StatusChipColors } from './theme/types';
|
|
25
|
+
export { StatusChip } from './components/common/StatusChip';
|
|
26
|
+
export { mapCreditGrantStatusToVariant } from './components/credits/grants/utils';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface Logger {
|
|
2
|
+
log: (message: string, object?: Record<string, string>) => void;
|
|
3
|
+
debug: (message: string, object?: Record<string, string>) => void;
|
|
4
|
+
error: (message: string, error?: Error, ...params: Record<string, string>[]) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare class LoggerService implements Logger {
|
|
7
|
+
error(message: string, error?: Error, ...params: Record<string, string>[]): void;
|
|
8
|
+
log(message: string, object?: Record<string, string>): void;
|
|
9
|
+
debug(message: string, object?: Record<string, string>): void;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: LoggerService;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const BASE_FEE_MONTHLY = 200;
|
|
2
|
+
export declare const BASE_FEE_YEARLY: number;
|
|
3
|
+
export declare const TIERS: number[];
|
|
4
|
+
export declare const TIERS_PRICE_MONTHLY: number[];
|
|
5
|
+
export declare const TIERS_PRICE_YEARLY: number[];
|
|
6
|
+
export declare const PER_UNIT_PRICE_MONTHLY = 12;
|
|
7
|
+
export declare const PER_UNIT_PRICE_YEARLY: number;
|
|
8
|
+
export declare const ADDON_PRICE_MONTHLY = 50;
|
|
9
|
+
export declare const ADDON_PRICE_YEARLY: number;
|
|
10
|
+
export declare const STRIPE_MOCK_ACCOUNT_ID = "acct_1NnHoQG6EyqgvTaj";
|
|
11
|
+
export declare const STRIPE_MOCK_ACCOUNT_PK = "pk_test_51NnHoQG6EyqgvTajznajopWC01AozNtq7zgySeQ1qx4PH9TAXvMj0TnbZvYT3yOt46jbQAcCDs1EU2QKcfG8eEoO00tlW0Jp3r";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React, PropsWithChildren } from 'react';
|
|
2
|
+
import { DeepPartial } from '../types';
|
|
3
|
+
import { StiggTheme } from './types';
|
|
4
|
+
export type CustomizedTheme = DeepPartial<StiggTheme>;
|
|
5
|
+
type SdkThemeProviderProps = {
|
|
6
|
+
componentTheme?: CustomizedTheme;
|
|
7
|
+
};
|
|
8
|
+
export declare function useStiggTheme(remoteThemeOverride?: CustomizedTheme): StiggTheme;
|
|
9
|
+
export declare const SdkThemeProvider: React.FC<PropsWithChildren<SdkThemeProviderProps>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { HorizontalAlignment, StiggTheme } from './types';
|
|
2
|
+
import { CustomizedTheme } from './Theme';
|
|
3
|
+
export declare const flexLayoutMapper: (horizontalAlignment: HorizontalAlignment) => string;
|
|
4
|
+
export declare const getResolvedTheme: (customizedTheme?: CustomizedTheme) => StiggTheme;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export type HorizontalAlignment = 'left' | 'center' | 'right';
|
|
2
|
+
export type TextAlignment = 'left' | 'center' | 'right';
|
|
3
|
+
export type FontVariant = {
|
|
4
|
+
fontSize: string;
|
|
5
|
+
fontWeight: 'bold' | 'normal';
|
|
6
|
+
semanticElement: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div';
|
|
7
|
+
};
|
|
8
|
+
export type StatusChipVariant = 'success' | 'warning' | 'error' | 'info' | 'neutral';
|
|
9
|
+
export type StatusChipColors = {
|
|
10
|
+
background: string;
|
|
11
|
+
text: string;
|
|
12
|
+
border: string;
|
|
13
|
+
};
|
|
14
|
+
export type StiggTheme = {
|
|
15
|
+
palette: {
|
|
16
|
+
primary: string;
|
|
17
|
+
primaryDark: string;
|
|
18
|
+
primaryLight: string;
|
|
19
|
+
backgroundPaper: string;
|
|
20
|
+
backgroundHighlight: string;
|
|
21
|
+
backgroundSection: string;
|
|
22
|
+
backgroundButton: string;
|
|
23
|
+
outlinedBorder: string;
|
|
24
|
+
outlinedRestingBorder: string;
|
|
25
|
+
outlinedHoverBackground: string;
|
|
26
|
+
switchBorder: string;
|
|
27
|
+
switchFill: string;
|
|
28
|
+
switchHandle: string;
|
|
29
|
+
warning: string;
|
|
30
|
+
error: string;
|
|
31
|
+
errorDark: string;
|
|
32
|
+
white: string;
|
|
33
|
+
success: string;
|
|
34
|
+
successDark: string;
|
|
35
|
+
text: {
|
|
36
|
+
primary: string;
|
|
37
|
+
secondary: string;
|
|
38
|
+
tertiary: string;
|
|
39
|
+
disabled: string;
|
|
40
|
+
};
|
|
41
|
+
statusChips: {
|
|
42
|
+
success: StatusChipColors;
|
|
43
|
+
warning: StatusChipColors;
|
|
44
|
+
error: StatusChipColors;
|
|
45
|
+
info: StatusChipColors;
|
|
46
|
+
neutral: StatusChipColors;
|
|
47
|
+
};
|
|
48
|
+
progress: {
|
|
49
|
+
background: string;
|
|
50
|
+
low: string;
|
|
51
|
+
medium: string;
|
|
52
|
+
high: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
layout: {
|
|
56
|
+
planMinWidth: string;
|
|
57
|
+
planMaxWidth: string;
|
|
58
|
+
planMargin: string;
|
|
59
|
+
planPadding: string;
|
|
60
|
+
ctaAlignment: HorizontalAlignment;
|
|
61
|
+
headerAlignment: HorizontalAlignment;
|
|
62
|
+
descriptionAlignment: TextAlignment;
|
|
63
|
+
descriptionMinHeight: string;
|
|
64
|
+
switchBottomSpacing: string;
|
|
65
|
+
};
|
|
66
|
+
shadows: {
|
|
67
|
+
light: string;
|
|
68
|
+
popover: string;
|
|
69
|
+
};
|
|
70
|
+
border: {
|
|
71
|
+
radius: string;
|
|
72
|
+
};
|
|
73
|
+
typography: {
|
|
74
|
+
fontFamily: string;
|
|
75
|
+
fontFamilyUrl?: string;
|
|
76
|
+
h1: FontVariant;
|
|
77
|
+
h2: FontVariant;
|
|
78
|
+
h3: FontVariant;
|
|
79
|
+
body: FontVariant;
|
|
80
|
+
caption: FontVariant;
|
|
81
|
+
};
|
|
82
|
+
customCss?: string;
|
|
83
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BillingPeriod } from '@stigg/js-client-sdk';
|
|
2
|
+
export type DeepPartial<T> = T extends object ? {
|
|
3
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
4
|
+
} : T;
|
|
5
|
+
export type DowngradeChangeVariables = {
|
|
6
|
+
addonRefIds?: string;
|
|
7
|
+
billingPeriod?: BillingPeriod;
|
|
8
|
+
downgradePlanRefId: string;
|
|
9
|
+
};
|
|
10
|
+
export type BillingPeriodChangeVariables = {
|
|
11
|
+
billingPeriod?: BillingPeriod;
|
|
12
|
+
};
|
|
13
|
+
export type UnitAmountChangeVariables = {
|
|
14
|
+
newUnitAmount?: number;
|
|
15
|
+
featureId: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
var u = "https://js.stripe.com/v3", s = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;
|
|
2
|
+
var l = function() {
|
|
3
|
+
for (var e = document.querySelectorAll('script[src^="'.concat(u, '"]')), t = 0; t < e.length; t++) {
|
|
4
|
+
var r = e[t];
|
|
5
|
+
if (s.test(r.src))
|
|
6
|
+
return r;
|
|
7
|
+
}
|
|
8
|
+
return null;
|
|
9
|
+
}, p = function(e) {
|
|
10
|
+
var t = "", r = document.createElement("script");
|
|
11
|
+
r.src = "".concat(u).concat(t);
|
|
12
|
+
var n = document.head || document.body;
|
|
13
|
+
if (!n)
|
|
14
|
+
throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
|
|
15
|
+
return n.appendChild(r), r;
|
|
16
|
+
}, f = function(e, t) {
|
|
17
|
+
!e || !e._registerWrapper || e._registerWrapper({
|
|
18
|
+
name: "stripe-js",
|
|
19
|
+
version: "1.54.1",
|
|
20
|
+
startTime: t
|
|
21
|
+
});
|
|
22
|
+
}, a = null, v = function(e) {
|
|
23
|
+
return a !== null || (a = new Promise(function(t, r) {
|
|
24
|
+
if (typeof window > "u" || typeof document > "u") {
|
|
25
|
+
t(null);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (window.Stripe) {
|
|
29
|
+
t(window.Stripe);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
var n = l();
|
|
34
|
+
n && e || n || (n = p(e)), n.addEventListener("load", function() {
|
|
35
|
+
window.Stripe ? t(window.Stripe) : r(new Error("Stripe.js not available"));
|
|
36
|
+
}), n.addEventListener("error", function() {
|
|
37
|
+
r(new Error("Failed to load Stripe.js"));
|
|
38
|
+
});
|
|
39
|
+
} catch (o) {
|
|
40
|
+
r(o);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
})), a;
|
|
44
|
+
}, S = function(e, t, r) {
|
|
45
|
+
if (e === null)
|
|
46
|
+
return null;
|
|
47
|
+
var n = e.apply(void 0, t);
|
|
48
|
+
return f(n, r), n;
|
|
49
|
+
}, c = Promise.resolve().then(function() {
|
|
50
|
+
return v(null);
|
|
51
|
+
}), d = !1;
|
|
52
|
+
c.catch(function(i) {
|
|
53
|
+
d || console.warn(i);
|
|
54
|
+
});
|
|
55
|
+
var m = function() {
|
|
56
|
+
for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
|
|
57
|
+
t[r] = arguments[r];
|
|
58
|
+
d = !0;
|
|
59
|
+
var n = Date.now();
|
|
60
|
+
return c.then(function(o) {
|
|
61
|
+
return S(o, t, n);
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
m as loadStripe
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=stripe.esm-BkoVJ3BR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stripe.esm-BkoVJ3BR.js","sources":["../node_modules/@stripe/stripe-js/dist/stripe.esm.js"],"sourcesContent":["var V3_URL = 'https://js.stripe.com/v3';\nvar V3_URL_REGEX = /^https:\\/\\/js\\.stripe\\.com\\/v3\\/?(\\?.*)?$/;\nvar EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';\nvar findScript = function findScript() {\n var scripts = document.querySelectorAll(\"script[src^=\\\"\".concat(V3_URL, \"\\\"]\"));\n\n for (var i = 0; i < scripts.length; i++) {\n var script = scripts[i];\n\n if (!V3_URL_REGEX.test(script.src)) {\n continue;\n }\n\n return script;\n }\n\n return null;\n};\n\nvar injectScript = function injectScript(params) {\n var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : '';\n var script = document.createElement('script');\n script.src = \"\".concat(V3_URL).concat(queryString);\n var headOrBody = document.head || document.body;\n\n if (!headOrBody) {\n throw new Error('Expected document.body not to be null. Stripe.js requires a <body> element.');\n }\n\n headOrBody.appendChild(script);\n return script;\n};\n\nvar registerWrapper = function registerWrapper(stripe, startTime) {\n if (!stripe || !stripe._registerWrapper) {\n return;\n }\n\n stripe._registerWrapper({\n name: 'stripe-js',\n version: \"1.54.1\",\n startTime: startTime\n });\n};\n\nvar stripePromise = null;\nvar loadScript = function loadScript(params) {\n // Ensure that we only attempt to load Stripe.js at most once\n if (stripePromise !== null) {\n return stripePromise;\n }\n\n stripePromise = new Promise(function (resolve, reject) {\n if (typeof window === 'undefined' || typeof document === 'undefined') {\n // Resolve to null when imported server side. This makes the module\n // safe to import in an isomorphic code base.\n resolve(null);\n return;\n }\n\n if (window.Stripe && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n }\n\n if (window.Stripe) {\n resolve(window.Stripe);\n return;\n }\n\n try {\n var script = findScript();\n\n if (script && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n } else if (!script) {\n script = injectScript(params);\n }\n\n script.addEventListener('load', function () {\n if (window.Stripe) {\n resolve(window.Stripe);\n } else {\n reject(new Error('Stripe.js not available'));\n }\n });\n script.addEventListener('error', function () {\n reject(new Error('Failed to load Stripe.js'));\n });\n } catch (error) {\n reject(error);\n return;\n }\n });\n return stripePromise;\n};\nvar initStripe = function initStripe(maybeStripe, args, startTime) {\n if (maybeStripe === null) {\n return null;\n }\n\n var stripe = maybeStripe.apply(undefined, args);\n registerWrapper(stripe, startTime);\n return stripe;\n}; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\n// own script injection.\n\nvar stripePromise$1 = Promise.resolve().then(function () {\n return loadScript(null);\n});\nvar loadCalled = false;\nstripePromise$1[\"catch\"](function (err) {\n if (!loadCalled) {\n console.warn(err);\n }\n});\nvar loadStripe = function loadStripe() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n loadCalled = true;\n var startTime = Date.now();\n return stripePromise$1.then(function (maybeStripe) {\n return initStripe(maybeStripe, args, startTime);\n });\n};\n\nexport { loadStripe };\n"],"names":["V3_URL","V3_URL_REGEX","findScript","scripts","i","script","injectScript","params","queryString","headOrBody","registerWrapper","stripe","startTime","stripePromise","loadScript","resolve","reject","error","initStripe","maybeStripe","args","stripePromise$1","loadCalled","err","loadStripe","_len","_key"],"mappings":"AAAA,IAAIA,IAAS,4BACTC,IAAe;AAEnB,IAAIC,IAAa,WAAsB;AAGrC,WAFIC,IAAU,SAAS,iBAAiB,gBAAiB,OAAOH,GAAQ,IAAK,CAAC,GAErEI,IAAI,GAAGA,IAAID,EAAQ,QAAQC,KAAK;AACvC,QAAIC,IAASF,EAAQC,CAAC;AAEtB,QAAKH,EAAa,KAAKI,EAAO,GAAG;AAIjC,aAAOA;AAAA,EACT;AAEA,SAAO;AACT,GAEIC,IAAe,SAAsBC,GAAQ;AAC/C,MAAIC,IAAuF,IACvFH,IAAS,SAAS,cAAc,QAAQ;AAC5C,EAAAA,EAAO,MAAM,GAAG,OAAOL,CAAM,EAAE,OAAOQ,CAAW;AACjD,MAAIC,IAAa,SAAS,QAAQ,SAAS;AAE3C,MAAI,CAACA;AACH,UAAM,IAAI,MAAM,6EAA6E;AAG/F,SAAAA,EAAW,YAAYJ,CAAM,GACtBA;AACT,GAEIK,IAAkB,SAAyBC,GAAQC,GAAW;AAChE,EAAI,CAACD,KAAU,CAACA,EAAO,oBAIvBA,EAAO,iBAAiB;AAAA,IACtB,MAAM;AAAA,IACN,SAAS;AAAA,IACT,WAAWC;AAAA,EACf,CAAG;AACH,GAEIC,IAAgB,MAChBC,IAAa,SAAoBP,GAAQ;AAE3C,SAAIM,MAAkB,SAItBA,IAAgB,IAAI,QAAQ,SAAUE,GAASC,GAAQ;AACrD,QAAI,OAAO,SAAW,OAAe,OAAO,WAAa,KAAa;AAGpE,MAAAD,EAAQ,IAAI;AACZ;AAAA,IACF;AAMA,QAAI,OAAO,QAAQ;AACjB,MAAAA,EAAQ,OAAO,MAAM;AACrB;AAAA,IACF;AAEA,QAAI;AACF,UAAIV,IAASH,EAAU;AAEvB,MAAIG,KAAUE,KAEFF,MACVA,IAASC,EAAaC,CAAM,IAG9BF,EAAO,iBAAiB,QAAQ,WAAY;AAC1C,QAAI,OAAO,SACTU,EAAQ,OAAO,MAAM,IAErBC,EAAO,IAAI,MAAM,yBAAyB,CAAC;AAAA,MAE/C,CAAC,GACDX,EAAO,iBAAiB,SAAS,WAAY;AAC3C,QAAAW,EAAO,IAAI,MAAM,0BAA0B,CAAC;AAAA,MAC9C,CAAC;AAAA,IACH,SAASC,GAAO;AACd,MAAAD,EAAOC,CAAK;AACZ;AAAA,IACF;AAAA,EACF,CAAC,IACMJ;AACT,GACIK,IAAa,SAAoBC,GAAaC,GAAMR,GAAW;AACjE,MAAIO,MAAgB;AAClB,WAAO;AAGT,MAAIR,IAASQ,EAAY,MAAM,QAAWC,CAAI;AAC9C,SAAAV,EAAgBC,GAAQC,CAAS,GAC1BD;AACT,GAIIU,IAAkB,QAAQ,QAAO,EAAG,KAAK,WAAY;AACvD,SAAOP,EAAW,IAAI;AACxB,CAAC,GACGQ,IAAa;AACjBD,EAAgB,MAAS,SAAUE,GAAK;AACtC,EAAKD,KACH,QAAQ,KAAKC,CAAG;AAEpB,CAAC;AACE,IAACC,IAAa,WAAsB;AACrC,WAASC,IAAO,UAAU,QAAQL,IAAO,IAAI,MAAMK,CAAI,GAAGC,IAAO,GAAGA,IAAOD,GAAMC;AAC/E,IAAAN,EAAKM,CAAI,IAAI,UAAUA,CAAI;AAG7B,EAAAJ,IAAa;AACb,MAAIV,IAAY,KAAK,IAAG;AACxB,SAAOS,EAAgB,KAAK,SAAUF,GAAa;AACjD,WAAOD,EAAWC,GAAaC,GAAMR,CAAS;AAAA,EAChD,CAAC;AACH;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var u="https://js.stripe.com/v3",l=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;var s=function(){for(var e=document.querySelectorAll('script[src^="'.concat(u,'"]')),t=0;t<e.length;t++){var r=e[t];if(l.test(r.src))return r}return null},p=function(e){var t="",r=document.createElement("script");r.src="".concat(u).concat(t);var n=document.head||document.body;if(!n)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return n.appendChild(r),r},f=function(e,t){!e||!e._registerWrapper||e._registerWrapper({name:"stripe-js",version:"1.54.1",startTime:t})},a=null,v=function(e){return a!==null||(a=new Promise(function(t,r){if(typeof window>"u"||typeof document>"u"){t(null);return}if(window.Stripe){t(window.Stripe);return}try{var n=s();n&&e||n||(n=p(e)),n.addEventListener("load",function(){window.Stripe?t(window.Stripe):r(new Error("Stripe.js not available"))}),n.addEventListener("error",function(){r(new Error("Failed to load Stripe.js"))})}catch(o){r(o);return}})),a},S=function(e,t,r){if(e===null)return null;var n=e.apply(void 0,t);return f(n,r),n},d=Promise.resolve().then(function(){return v(null)}),c=!1;d.catch(function(i){c||console.warn(i)});var m=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];c=!0;var n=Date.now();return d.then(function(o){return S(o,t,n)})};exports.loadStripe=m;
|
|
2
|
+
//# sourceMappingURL=stripe.esm-XRG9pJRV.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stripe.esm-XRG9pJRV.cjs","sources":["../node_modules/@stripe/stripe-js/dist/stripe.esm.js"],"sourcesContent":["var V3_URL = 'https://js.stripe.com/v3';\nvar V3_URL_REGEX = /^https:\\/\\/js\\.stripe\\.com\\/v3\\/?(\\?.*)?$/;\nvar EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';\nvar findScript = function findScript() {\n var scripts = document.querySelectorAll(\"script[src^=\\\"\".concat(V3_URL, \"\\\"]\"));\n\n for (var i = 0; i < scripts.length; i++) {\n var script = scripts[i];\n\n if (!V3_URL_REGEX.test(script.src)) {\n continue;\n }\n\n return script;\n }\n\n return null;\n};\n\nvar injectScript = function injectScript(params) {\n var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : '';\n var script = document.createElement('script');\n script.src = \"\".concat(V3_URL).concat(queryString);\n var headOrBody = document.head || document.body;\n\n if (!headOrBody) {\n throw new Error('Expected document.body not to be null. Stripe.js requires a <body> element.');\n }\n\n headOrBody.appendChild(script);\n return script;\n};\n\nvar registerWrapper = function registerWrapper(stripe, startTime) {\n if (!stripe || !stripe._registerWrapper) {\n return;\n }\n\n stripe._registerWrapper({\n name: 'stripe-js',\n version: \"1.54.1\",\n startTime: startTime\n });\n};\n\nvar stripePromise = null;\nvar loadScript = function loadScript(params) {\n // Ensure that we only attempt to load Stripe.js at most once\n if (stripePromise !== null) {\n return stripePromise;\n }\n\n stripePromise = new Promise(function (resolve, reject) {\n if (typeof window === 'undefined' || typeof document === 'undefined') {\n // Resolve to null when imported server side. This makes the module\n // safe to import in an isomorphic code base.\n resolve(null);\n return;\n }\n\n if (window.Stripe && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n }\n\n if (window.Stripe) {\n resolve(window.Stripe);\n return;\n }\n\n try {\n var script = findScript();\n\n if (script && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n } else if (!script) {\n script = injectScript(params);\n }\n\n script.addEventListener('load', function () {\n if (window.Stripe) {\n resolve(window.Stripe);\n } else {\n reject(new Error('Stripe.js not available'));\n }\n });\n script.addEventListener('error', function () {\n reject(new Error('Failed to load Stripe.js'));\n });\n } catch (error) {\n reject(error);\n return;\n }\n });\n return stripePromise;\n};\nvar initStripe = function initStripe(maybeStripe, args, startTime) {\n if (maybeStripe === null) {\n return null;\n }\n\n var stripe = maybeStripe.apply(undefined, args);\n registerWrapper(stripe, startTime);\n return stripe;\n}; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\n// own script injection.\n\nvar stripePromise$1 = Promise.resolve().then(function () {\n return loadScript(null);\n});\nvar loadCalled = false;\nstripePromise$1[\"catch\"](function (err) {\n if (!loadCalled) {\n console.warn(err);\n }\n});\nvar loadStripe = function loadStripe() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n loadCalled = true;\n var startTime = Date.now();\n return stripePromise$1.then(function (maybeStripe) {\n return initStripe(maybeStripe, args, startTime);\n });\n};\n\nexport { loadStripe };\n"],"names":["V3_URL","V3_URL_REGEX","findScript","scripts","i","script","injectScript","params","queryString","headOrBody","registerWrapper","stripe","startTime","stripePromise","loadScript","resolve","reject","error","initStripe","maybeStripe","args","stripePromise$1","loadCalled","err","loadStripe","_len","_key"],"mappings":"gFAAA,IAAIA,EAAS,2BACTC,EAAe,4CAEnB,IAAIC,EAAa,UAAsB,CAGrC,QAFIC,EAAU,SAAS,iBAAiB,gBAAiB,OAAOH,EAAQ,IAAK,CAAC,EAErEI,EAAI,EAAGA,EAAID,EAAQ,OAAQC,IAAK,CACvC,IAAIC,EAASF,EAAQC,CAAC,EAEtB,GAAKH,EAAa,KAAKI,EAAO,GAAG,EAIjC,OAAOA,CACT,CAEA,OAAO,IACT,EAEIC,EAAe,SAAsBC,EAAQ,CAC/C,IAAIC,EAAuF,GACvFH,EAAS,SAAS,cAAc,QAAQ,EAC5CA,EAAO,IAAM,GAAG,OAAOL,CAAM,EAAE,OAAOQ,CAAW,EACjD,IAAIC,EAAa,SAAS,MAAQ,SAAS,KAE3C,GAAI,CAACA,EACH,MAAM,IAAI,MAAM,6EAA6E,EAG/F,OAAAA,EAAW,YAAYJ,CAAM,EACtBA,CACT,EAEIK,EAAkB,SAAyBC,EAAQC,EAAW,CAC5D,CAACD,GAAU,CAACA,EAAO,kBAIvBA,EAAO,iBAAiB,CACtB,KAAM,YACN,QAAS,SACT,UAAWC,CACf,CAAG,CACH,EAEIC,EAAgB,KAChBC,EAAa,SAAoBP,EAAQ,CAE3C,OAAIM,IAAkB,OAItBA,EAAgB,IAAI,QAAQ,SAAUE,EAASC,EAAQ,CACrD,GAAI,OAAO,OAAW,KAAe,OAAO,SAAa,IAAa,CAGpED,EAAQ,IAAI,EACZ,MACF,CAMA,GAAI,OAAO,OAAQ,CACjBA,EAAQ,OAAO,MAAM,EACrB,MACF,CAEA,GAAI,CACF,IAAIV,EAASH,EAAU,EAEnBG,GAAUE,GAEFF,IACVA,EAASC,EAAaC,CAAM,GAG9BF,EAAO,iBAAiB,OAAQ,UAAY,CACtC,OAAO,OACTU,EAAQ,OAAO,MAAM,EAErBC,EAAO,IAAI,MAAM,yBAAyB,CAAC,CAE/C,CAAC,EACDX,EAAO,iBAAiB,QAAS,UAAY,CAC3CW,EAAO,IAAI,MAAM,0BAA0B,CAAC,CAC9C,CAAC,CACH,OAASC,EAAO,CACdD,EAAOC,CAAK,EACZ,MACF,CACF,CAAC,GACMJ,CACT,EACIK,EAAa,SAAoBC,EAAaC,EAAMR,EAAW,CACjE,GAAIO,IAAgB,KAClB,OAAO,KAGT,IAAIR,EAASQ,EAAY,MAAM,OAAWC,CAAI,EAC9C,OAAAV,EAAgBC,EAAQC,CAAS,EAC1BD,CACT,EAIIU,EAAkB,QAAQ,QAAO,EAAG,KAAK,UAAY,CACvD,OAAOP,EAAW,IAAI,CACxB,CAAC,EACGQ,EAAa,GACjBD,EAAgB,MAAS,SAAUE,EAAK,CACjCD,GACH,QAAQ,KAAKC,CAAG,CAEpB,CAAC,EACE,IAACC,EAAa,UAAsB,CACrC,QAASC,EAAO,UAAU,OAAQL,EAAO,IAAI,MAAMK,CAAI,EAAGC,EAAO,EAAGA,EAAOD,EAAMC,IAC/EN,EAAKM,CAAI,EAAI,UAAUA,CAAI,EAG7BJ,EAAa,GACb,IAAIV,EAAY,KAAK,IAAG,EACxB,OAAOS,EAAgB,KAAK,SAAUF,EAAa,CACjD,OAAOD,EAAWC,EAAaC,EAAMR,CAAS,CAChD,CAAC,CACH","x_google_ignoreList":[0]}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "7.
|
|
2
|
+
"version": "7.8.0",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/react-sdk.cjs.js",
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"./dist/styles.css": "./dist/styles.css"
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
18
|
-
"dist"
|
|
18
|
+
"dist",
|
|
19
|
+
"src"
|
|
19
20
|
],
|
|
20
21
|
"engines": {
|
|
21
22
|
"node": ">=22"
|
|
@@ -56,6 +57,16 @@
|
|
|
56
57
|
"author": {
|
|
57
58
|
"name": "Stigg"
|
|
58
59
|
},
|
|
60
|
+
"size-limit": [
|
|
61
|
+
{
|
|
62
|
+
"path": "dist/react-sdk.cjs.js",
|
|
63
|
+
"limit": "10 KB"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"path": "dist/react-sdk.esm.js",
|
|
67
|
+
"limit": "10 KB"
|
|
68
|
+
}
|
|
69
|
+
],
|
|
59
70
|
"devDependencies": {
|
|
60
71
|
"@commitlint/cli": "^19.7.1",
|
|
61
72
|
"@commitlint/config-conventional": "^19.7.1",
|
|
@@ -125,5 +136,6 @@
|
|
|
125
136
|
"react-spinners": "^0.13.3",
|
|
126
137
|
"react-switch": "^7.0.0"
|
|
127
138
|
},
|
|
128
|
-
"readme": "ERROR: No README data found!"
|
|
139
|
+
"readme": "ERROR: No README data found!",
|
|
140
|
+
"_id": "@stigg/react-sdk@5.23.0"
|
|
129
141
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_834_118930)">
|
|
3
|
+
<path d="M12 6.85712V17.1428" stroke="#7586B0" stroke-width="1.71429" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
<path d="M6.85712 12H17.1428" stroke="#7586B0" stroke-width="1.71429" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
+
<path d="M18 0.857117H5.99997C3.15966 0.857117 0.857117 3.15966 0.857117 5.99997V18C0.857117 20.8404 3.15966 23.1428 5.99997 23.1428H18C20.8404 23.1428 23.1428 20.8404 23.1428 18V5.99997C23.1428 3.15966 20.8404 0.857117 18 0.857117Z" stroke="#7586B0" stroke-width="1.71429" stroke-linecap="round" stroke-linejoin="round"/>
|
|
6
|
+
</g>
|
|
7
|
+
<defs>
|
|
8
|
+
<clipPath id="clip0_834_118930">
|
|
9
|
+
<rect width="24" height="24" fill="white"/>
|
|
10
|
+
</clipPath>
|
|
11
|
+
</defs>
|
|
12
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g id="arrow-right">
|
|
3
|
+
<path id="Shape" d="M2.66699 8H13.3337" stroke="#7586B0" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
<path id="Shape_2" d="M9.33301 4L13.333 8L9.33301 12" stroke="#7586B0" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
+
</g>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect width="36" height="36" rx="10" fill="#F5F6F9"/>
|
|
3
|
+
<path d="M26 27V25C26 22.7909 24.2091 21 22 21H14C11.7909 21 10 22.7909 10 25V27" stroke="#7586B0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 17C20.2091 17 22 15.2091 22 13C22 10.7909 20.2091 9 18 9C15.7909 9 14 10.7909 14 13C14 15.2091 15.7909 17 18 17Z" stroke="#7586B0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
+
<defs>
|
|
6
|
+
<linearGradient id="paint0_linear_67_8545" x1="35.0204" y1="1.22449" x2="0" y2="36" gradientUnits="userSpaceOnUse">
|
|
7
|
+
<stop stop-color="#56ACF6"/>
|
|
8
|
+
<stop offset="1" stop-color="#1559E6"/>
|
|
9
|
+
</linearGradient>
|
|
10
|
+
</defs>
|
|
11
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="15" height="11" viewBox="0 0 15 11" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M5.59 7.9899L2.125 4.5249C1.73524 4.13514 1.10365 4.13402 0.712509 4.52241V4.52241C0.319409 4.91274 0.318286 5.54819 0.710005 5.9399L5.59 10.8199L14.2948 2.11513C14.6843 1.72565 14.6843 1.09417 14.2948 0.704691V0.704691C13.9055 0.315381 13.2743 0.315184 12.8848 0.70425L5.59 7.9899Z" fill="#B2BBD3"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M15.8337 5.34199L14.6587 4.16699L10.0003 8.82533L5.34199 4.16699L4.16699 5.34199L8.82533 10.0003L4.16699 14.6587L5.34199 15.8337L10.0003 11.1753L14.6587 15.8337L15.8337 14.6587L11.1753 10.0003L15.8337 5.34199Z" fill="#327EEE"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect width="36" height="36" rx="10" fill="#F5F6F9"/>
|
|
3
|
+
<path d="M27 18.22C27 12.73 22.74 9 18 9C13.31 9 9 12.65 9 18.28C8.4 18.62 8 19.26 8 20V22C8 23.1 8.9 24 10 24H11V17.9C11 14.03 14.13 10.9 18 10.9C21.87 10.9 25 14.03 25 17.9V25H17V27H25C26.1 27 27 26.1 27 25V23.78C27.59 23.47 28 22.86 28 22.14V19.84C28 19.14 27.59 18.53 27 18.22Z" fill="#7586B0"/>
|
|
4
|
+
<path d="M15 20C15.5523 20 16 19.5523 16 19C16 18.4477 15.5523 18 15 18C14.4477 18 14 18.4477 14 19C14 19.5523 14.4477 20 15 20Z" fill="#7586B0"/>
|
|
5
|
+
<path d="M21 20C21.5523 20 22 19.5523 22 19C22 18.4477 21.5523 18 21 18C20.4477 18 20 18.4477 20 19C20 19.5523 20.4477 20 21 20Z" fill="#7586B0"/>
|
|
6
|
+
<path d="M24 17.03C23.52 14.18 21.04 12 18.05 12C15.02 12 11.76 14.51 12.02 18.45C14.49 17.44 16.35 15.24 16.88 12.56C18.19 15.19 20.88 17 24 17.03Z" fill="#7586B0"/>
|
|
7
|
+
<defs>
|
|
8
|
+
<linearGradient id="paint0_linear_267_19310" x1="35.0204" y1="1.22449" x2="0" y2="36" gradientUnits="userSpaceOnUse">
|
|
9
|
+
<stop stop-color="#56ACF6"/>
|
|
10
|
+
<stop offset="1" stop-color="#1559E6"/>
|
|
11
|
+
</linearGradient>
|
|
12
|
+
</defs>
|
|
13
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g id="tag--tags-bookmark-favorite">
|
|
3
|
+
<path id="Vector" d="M1.26995 11.9426L6.05743 16.7301C6.2305 16.903 6.4651 17.0001 6.7097 17.0001C6.95431 17.0001 7.18891 16.903 7.36198 16.7301L16.8631 7.22895C16.9108 7.18332 16.9478 7.12758 16.9712 7.06583C16.9946 7.00408 17.0039 6.93787 16.9985 6.87205L16.2724 2.15839C16.2664 2.04607 16.2192 1.93992 16.1396 1.86038C16.0601 1.78085 15.9539 1.73357 15.8416 1.72764L11.128 1.00152C11.0622 0.996055 10.9959 1.00538 10.9342 1.0288C10.8724 1.05222 10.8167 1.08916 10.7711 1.1369L1.26995 10.638C1.09709 10.8111 1 11.0457 1 11.2903C1 11.5349 1.09709 11.7695 1.26995 11.9426Z" stroke="#327EEE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
<path id="Vector_2" d="M12.5548 6.05884C12.3916 6.05884 12.2351 5.99401 12.1197 5.87861C12.0043 5.76321 11.9395 5.60669 11.9395 5.44348C11.9395 5.28028 12.0043 5.12376 12.1197 5.00836C12.2351 4.89296 12.3916 4.82812 12.5548 4.82812C12.718 4.82812 12.8745 4.89296 12.9899 5.00836C13.1053 5.12376 13.1702 5.28028 13.1702 5.44348C13.1702 5.60669 13.1053 5.76321 12.9899 5.87861C12.8745 5.99401 12.718 6.05884 12.5548 6.05884Z" stroke="#327EEE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
+
</g>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect width="36" height="36" rx="10" fill="#F5F6F9"/>
|
|
3
|
+
<path d="M26 10H10C8.89 10 8.01 10.89 8.01 12L8 24C8 25.11 8.89 26 10 26H26C27.11 26 28 25.11 28 24V12C28 10.89 27.11 10 26 10ZM26 24H10V18H26V24ZM26 14H10V12H26V14Z" fill="#7586B0"/>
|
|
4
|
+
<defs>
|
|
5
|
+
<linearGradient id="paint0_linear_67_8556" x1="35.0204" y1="1.22449" x2="0" y2="36" gradientUnits="userSpaceOnUse">
|
|
6
|
+
<stop stop-color="#56ACF6"/>
|
|
7
|
+
<stop offset="1" stop-color="#1559E6"/>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
</defs>
|
|
10
|
+
</svg>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_834_120339)">
|
|
3
|
+
<path d="M10.3336 19.2858C15.462 19.2858 19.6193 15.1285 19.6193 10.0001C19.6193 4.87171 15.462 0.714355 10.3336 0.714355C5.20521 0.714355 1.04785 4.87171 1.04785 10.0001C1.04785 15.1285 5.20521 19.2858 10.3336 19.2858Z" stroke="#7586B0" stroke-width="1.71429" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
<path d="M12.7649 7.46052C12.6813 7.22393 12.5523 7.0088 12.3883 6.8256C12.0395 6.43592 11.5327 6.19067 10.9685 6.19067H9.4942C8.55517 6.19067 7.79395 6.9519 7.79395 7.89093C7.79395 8.68995 8.3503 9.38116 9.13086 9.5519L11.3756 10.0429C12.25 10.2342 12.8733 11.0091 12.8733 11.9043C12.8733 12.9562 12.0205 13.8097 10.9685 13.8097H9.6987C8.86936 13.8097 8.16382 13.2797 7.90233 12.5399" stroke="#7586B0" stroke-width="1.71429" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
+
<path d="M10.3335 6.19065V4.28589" stroke="#7586B0" stroke-width="1.71429" stroke-linecap="round" stroke-linejoin="round"/>
|
|
6
|
+
<path d="M10.3335 15.7144V13.8096" stroke="#7586B0" stroke-width="1.71429" stroke-linecap="round" stroke-linejoin="round"/>
|
|
7
|
+
</g>
|
|
8
|
+
<defs>
|
|
9
|
+
<clipPath id="clip0_834_120339">
|
|
10
|
+
<rect width="20" height="20" fill="white" transform="translate(0.333496)"/>
|
|
11
|
+
</clipPath>
|
|
12
|
+
</defs>
|
|
13
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.3333 2.5L17.5 6.66667L6.66667 17.5H2.5V13.3333L13.3333 2.5V2.5Z" stroke="#327EEE" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
</svg>
|