@stigg/react-sdk 4.3.0-beta.1 → 4.3.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 +1 -1
- package/dist/components/common/Icon.d.ts +2 -3
- package/dist/components/common/PoweredByStigg.d.ts +1 -1
- package/dist/components/common/customIcons.d.ts +5 -17
- package/dist/components/common/mapExternalTheme.d.ts +1 -2
- package/dist/components/customerPortal/subscriptionOverview/tabs/SubscriptionTabs.d.ts +1 -1
- package/dist/components/{common/TiersSelectContainer.d.ts → paywall/TiersLayout.d.ts} +3 -2
- package/dist/components/paywall/paywallTextOverrides.d.ts +2 -0
- package/dist/components/{utils/priceTierUtils.d.ts → paywall/planPriceTier.d.ts} +1 -3
- package/dist/components/utils/calculateDiscountRate.d.ts +0 -1
- package/dist/components/utils/currencyUtils.d.ts +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/react-sdk.cjs.development.js +207 -3479
- package/dist/react-sdk.cjs.development.js.map +1 -1
- package/dist/react-sdk.cjs.production.min.js +1 -1
- package/dist/react-sdk.cjs.production.min.js.map +1 -1
- package/dist/react-sdk.esm.js +213 -3619
- package/dist/react-sdk.esm.js.map +1 -1
- package/dist/stories/CustomerPortal.stories.d.ts +1 -1
- package/dist/theme/getResolvedTheme.d.ts +0 -1
- package/dist/theme/types.d.ts +0 -1
- package/package.json +22 -11
- package/src/components/StiggProvider.tsx +2 -0
- package/src/components/common/Icon.tsx +22 -17
- package/src/components/common/PoweredByStigg.tsx +1 -1
- package/src/components/common/Typography.tsx +1 -11
- package/src/components/common/customIcons.ts +28 -17
- package/src/components/common/mapExternalTheme.ts +8 -24
- package/src/components/customerPortal/subscriptionOverview/tabs/SubscriptionTabs.tsx +12 -6
- package/src/components/paywall/Paywall.tsx +1 -1
- package/src/components/paywall/PlanOffering.tsx +1 -1
- package/src/components/paywall/PlanOfferingButton.tsx +1 -1
- package/src/components/paywall/PlanPrice.tsx +13 -5
- package/src/components/{common/TiersSelectContainer.tsx → paywall/TiersLayout.tsx} +7 -8
- package/src/components/paywall/paywallTextOverrides.ts +1 -0
- package/src/components/{utils/priceTierUtils.ts → paywall/planPriceTier.ts} +3 -25
- package/src/components/paywall/utils/calculateUnitQuantityText.ts +4 -9
- package/src/components/utils/calculateDiscountRate.ts +1 -1
- package/src/components/utils/currencyUtils.ts +1 -1
- package/src/components/utils/getPaidPriceText.ts +2 -2
- package/src/index.ts +0 -1
- package/src/stories/CustomerPortal.stories.tsx +12 -12
- package/src/stories/Paywall.stories.tsx +4 -6
- package/src/stories/baseArgs.ts +1 -1
- package/src/theme/Fonts.tsx +1 -1
- package/src/theme/Theme.tsx +7 -9
- package/src/theme/getResolvedTheme.ts +0 -1
- package/src/theme/types.ts +0 -1
- package/dist/components/checkout/Checkout.d.ts +0 -5
- package/dist/components/checkout/CheckoutContainer.d.ts +0 -22
- package/dist/components/checkout/CheckoutContainer.style.d.ts +0 -26
- package/dist/components/checkout/CheckoutProvider.d.ts +0 -35
- package/dist/components/checkout/CheckoutSummary.d.ts +0 -9
- package/dist/components/checkout/components/Button.d.ts +0 -6
- package/dist/components/checkout/components/InputField.d.ts +0 -8
- package/dist/components/checkout/components/index.d.ts +0 -2
- package/dist/components/checkout/formatting.d.ts +0 -2
- package/dist/components/checkout/hooks/index.d.ts +0 -8
- package/dist/components/checkout/hooks/useAddonsStepModel.d.ts +0 -21
- package/dist/components/checkout/hooks/useCheckoutModel.d.ts +0 -9
- package/dist/components/checkout/hooks/useCouponModel.d.ts +0 -7
- package/dist/components/checkout/hooks/useLoadCheckout.d.ts +0 -11
- package/dist/components/checkout/hooks/usePaymentStepModel.d.ts +0 -16
- package/dist/components/checkout/hooks/usePlanStepModel.d.ts +0 -23
- package/dist/components/checkout/hooks/usePreviewSubscription.d.ts +0 -13
- package/dist/components/checkout/hooks/useProgressBarModel.d.ts +0 -26
- package/dist/components/checkout/hooks/useSubscriptionModel.d.ts +0 -5
- package/dist/components/checkout/hooks/useSubscriptionState.d.ts +0 -2
- package/dist/components/checkout/index.d.ts +0 -3
- package/dist/components/checkout/planHeader/PlanHeader.d.ts +0 -7
- package/dist/components/checkout/planHeader/PlanHeader.style.d.ts +0 -25
- package/dist/components/checkout/planHeader/index.d.ts +0 -1
- package/dist/components/checkout/progressBar/CheckoutProgressBar.d.ts +0 -2
- package/dist/components/checkout/progressBar/CheckoutProgressBar.style.d.ts +0 -45
- package/dist/components/checkout/promotionCode/AddPromotionCode.d.ts +0 -5
- package/dist/components/checkout/promotionCode/AddPromotionCodeButton.d.ts +0 -7
- package/dist/components/checkout/promotionCode/AppliedPromotionCode.d.ts +0 -6
- package/dist/components/checkout/promotionCode/PromotionCodeSection.d.ts +0 -5
- package/dist/components/checkout/promotionCode/index.d.ts +0 -1
- package/dist/components/checkout/steps/addons/CheckoutAddonsStep.d.ts +0 -2
- package/dist/components/checkout/steps/addons/CheckoutAddonsStep.style.d.ts +0 -93
- package/dist/components/checkout/steps/addons/addon.utils.d.ts +0 -15
- package/dist/components/checkout/steps/addons/index.d.ts +0 -1
- package/dist/components/checkout/steps/payment/PaymentMethods.d.ts +0 -19
- package/dist/components/checkout/steps/payment/PaymentMethods.style.d.ts +0 -113
- package/dist/components/checkout/steps/payment/PaymentStep.d.ts +0 -2
- package/dist/components/checkout/steps/payment/index.d.ts +0 -1
- package/dist/components/checkout/steps/payment/stripe/StripePaymentForm.d.ts +0 -2
- package/dist/components/checkout/steps/payment/stripe/index.d.ts +0 -3
- package/dist/components/checkout/steps/payment/stripe/stripe.utils.d.ts +0 -33
- package/dist/components/checkout/steps/payment/stripe/useStripeIntegration.d.ts +0 -5
- package/dist/components/checkout/steps/payment/stripe/useSubmit.d.ts +0 -10
- package/dist/components/checkout/steps/plan/BillingPeriodPicker.d.ts +0 -9
- package/dist/components/checkout/steps/plan/BillingPeriodPicker.style.d.ts +0 -52
- package/dist/components/checkout/steps/plan/CheckoutChargeList.d.ts +0 -16
- package/dist/components/checkout/steps/plan/CheckoutPlanStep.d.ts +0 -4
- package/dist/components/checkout/steps/plan/CheckoutPlanStep.style.d.ts +0 -12
- package/dist/components/checkout/steps/plan/index.d.ts +0 -1
- package/dist/components/checkout/steps/surprise/SurpriseStep.d.ts +0 -2
- package/dist/components/checkout/textOverrides.d.ts +0 -28
- package/dist/components/checkout/theme.d.ts +0 -12
- package/dist/components/hooks/useChargeSort.d.ts +0 -3
- package/dist/components/utils/priceUtils.d.ts +0 -2
- package/dist/stories/Checkout.stories.d.ts +0 -3
- package/src/assets/arrow-forward.svg +0 -3
- package/src/assets/arrow-right.svg +0 -6
- package/src/assets/close.svg +0 -3
- package/src/assets/nyancat.svg +0 -634
- package/src/assets/outlined-checked-circle.svg +0 -6
- package/src/assets/outlined-circle.svg +0 -3
- package/src/assets/payment-method.svg +0 -11
- package/src/assets/plus-icon.svg +0 -6
- package/src/assets/trash.svg +0 -8
- package/src/components/checkout/Checkout.tsx +0 -30
- package/src/components/checkout/CheckoutContainer.style.ts +0 -34
- package/src/components/checkout/CheckoutContainer.tsx +0 -88
- package/src/components/checkout/CheckoutProvider.tsx +0 -140
- package/src/components/checkout/CheckoutSummary.tsx +0 -361
- package/src/components/checkout/components/Button.tsx +0 -30
- package/src/components/checkout/components/InputField.tsx +0 -22
- package/src/components/checkout/components/index.ts +0 -2
- package/src/components/checkout/formatting.ts +0 -12
- package/src/components/checkout/hooks/index.ts +0 -8
- package/src/components/checkout/hooks/useAddonsStepModel.ts +0 -96
- package/src/components/checkout/hooks/useCheckoutModel.ts +0 -31
- package/src/components/checkout/hooks/useCouponModel.ts +0 -28
- package/src/components/checkout/hooks/useLoadCheckout.ts +0 -40
- package/src/components/checkout/hooks/usePaymentStepModel.ts +0 -49
- package/src/components/checkout/hooks/usePlanStepModel.ts +0 -170
- package/src/components/checkout/hooks/usePreviewSubscription.ts +0 -82
- package/src/components/checkout/hooks/useProgressBarModel.ts +0 -89
- package/src/components/checkout/hooks/useSubscriptionModel.ts +0 -16
- package/src/components/checkout/hooks/useSubscriptionState.ts +0 -26
- package/src/components/checkout/index.ts +0 -3
- package/src/components/checkout/planHeader/PlanHeader.style.tsx +0 -23
- package/src/components/checkout/planHeader/PlanHeader.tsx +0 -61
- package/src/components/checkout/planHeader/index.ts +0 -1
- package/src/components/checkout/progressBar/CheckoutProgressBar.style.ts +0 -29
- package/src/components/checkout/progressBar/CheckoutProgressBar.tsx +0 -48
- package/src/components/checkout/promotionCode/AddPromotionCode.tsx +0 -85
- package/src/components/checkout/promotionCode/AddPromotionCodeButton.tsx +0 -39
- package/src/components/checkout/promotionCode/AppliedPromotionCode.tsx +0 -37
- package/src/components/checkout/promotionCode/PromotionCodeSection.tsx +0 -27
- package/src/components/checkout/promotionCode/index.ts +0 -1
- package/src/components/checkout/steps/addons/CheckoutAddonsStep.style.tsx +0 -24
- package/src/components/checkout/steps/addons/CheckoutAddonsStep.tsx +0 -125
- package/src/components/checkout/steps/addons/addon.utils.ts +0 -68
- package/src/components/checkout/steps/addons/index.ts +0 -1
- package/src/components/checkout/steps/payment/PaymentMethods.style.ts +0 -26
- package/src/components/checkout/steps/payment/PaymentMethods.tsx +0 -83
- package/src/components/checkout/steps/payment/PaymentStep.tsx +0 -41
- package/src/components/checkout/steps/payment/index.ts +0 -1
- package/src/components/checkout/steps/payment/stripe/StripePaymentForm.tsx +0 -43
- package/src/components/checkout/steps/payment/stripe/index.ts +0 -3
- package/src/components/checkout/steps/payment/stripe/stripe.utils.ts +0 -109
- package/src/components/checkout/steps/payment/stripe/useStripeIntegration.ts +0 -27
- package/src/components/checkout/steps/payment/stripe/useSubmit.ts +0 -100
- package/src/components/checkout/steps/plan/BillingPeriodPicker.style.tsx +0 -46
- package/src/components/checkout/steps/plan/BillingPeriodPicker.tsx +0 -63
- package/src/components/checkout/steps/plan/CheckoutChargeList.tsx +0 -138
- package/src/components/checkout/steps/plan/CheckoutPlanStep.style.tsx +0 -6
- package/src/components/checkout/steps/plan/CheckoutPlanStep.tsx +0 -22
- package/src/components/checkout/steps/plan/index.ts +0 -1
- package/src/components/checkout/steps/surprise/SurpriseStep.tsx +0 -27
- package/src/components/checkout/textOverrides.ts +0 -58
- package/src/components/checkout/theme.ts +0 -43
- package/src/components/hooks/useChargeSort.ts +0 -17
- package/src/components/utils/priceUtils.ts +0 -10
- package/src/stories/Checkout.stories.tsx +0 -62
package/README.md
CHANGED
|
@@ -186,7 +186,7 @@ yarn build-storybook
|
|
|
186
186
|
yarn publish-storybook
|
|
187
187
|
```
|
|
188
188
|
|
|
189
|
-
**NOTE:** The `
|
|
189
|
+
**NOTE:** The `BASE_URI` environment parameter in `.env.local` file controlling the API url that storybook is going to use.
|
|
190
190
|
|
|
191
191
|
### Link package
|
|
192
192
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
|
+
import { Icons } from './customIcons';
|
|
2
3
|
import { IconColor } from './iconColor';
|
|
3
|
-
import * as customIcons from './customIcons';
|
|
4
|
-
export declare type Icons = keyof typeof customIcons;
|
|
5
4
|
export declare type IconProps = {
|
|
6
5
|
icon: Icons;
|
|
7
6
|
className?: string;
|
|
@@ -10,4 +9,4 @@ export declare type IconProps = {
|
|
|
10
9
|
svgRectColor?: IconColor | string;
|
|
11
10
|
svgStrokeColor?: IconColor | string;
|
|
12
11
|
};
|
|
13
|
-
export declare function Icon({ icon, className, style, svgPathColor, svgRectColor, svgStrokeColor }: IconProps): JSX.Element;
|
|
12
|
+
export declare function Icon({ icon, className, style, svgPathColor, svgRectColor, svgStrokeColor, }: IconProps): JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export declare const STIGG_WATERMARK_CLASSNAME = "stigg-watermark";
|
|
3
|
-
export declare type PoweredByStiggSources = 'paywall' | 'customer_portal'
|
|
3
|
+
export declare type PoweredByStiggSources = 'paywall' | 'customer_portal';
|
|
4
4
|
declare type PoweredByStiggProps = {
|
|
5
5
|
source: PoweredByStiggSources;
|
|
6
6
|
showWatermark?: boolean;
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
export { default as MiniSchedule } from '../../assets/mini-schedule.svg';
|
|
7
|
-
export { default as Promotions } from '../../assets/promotions.svg';
|
|
8
|
-
export { default as Restore } from '../../assets/restore.svg';
|
|
9
|
-
export { default as ScheduleBox } from '../../assets/schedule-box.svg';
|
|
10
|
-
export { default as ScheduleClock } from '../../assets/schedule.svg';
|
|
11
|
-
export { default as RenewSubscription } from '../../assets/subscription-renews-icon.svg';
|
|
12
|
-
export { default as Trash } from '../../assets/trash.svg';
|
|
13
|
-
export { default as PaymentMethod } from '../../assets/payment-method.svg';
|
|
14
|
-
export { default as OutlinedCircle } from '../../assets/outlined-circle.svg';
|
|
15
|
-
export { default as OutlinedCheckedCircle } from '../../assets/outlined-checked-circle.svg';
|
|
16
|
-
export { default as ArrowForward } from '../../assets/arrow-forward.svg';
|
|
17
|
-
export { default as Close } from '../../assets/close.svg';
|
|
1
|
+
import { ReactElement, SVGProps } from 'react';
|
|
2
|
+
export declare const ICON_COMPONENTS: {
|
|
3
|
+
[name: string]: ((props: SVGProps<SVGElement>) => ReactElement);
|
|
4
|
+
};
|
|
5
|
+
export declare type Icons = keyof typeof ICON_COMPONENTS;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CustomerPortalConfiguration, PaywallConfiguration } from '@stigg/js-client-sdk';
|
|
2
2
|
import { CustomizedTheme } from '../../theme/Theme';
|
|
3
3
|
export declare function mapCustomerPortalConfiguration(configuration: CustomerPortalConfiguration): CustomizedTheme;
|
|
4
4
|
export declare function mapPaywallConfiguration(paywallConfiguration: PaywallConfiguration): CustomizedTheme;
|
|
5
|
-
export declare function mapCheckoutConfiguration(configuration: CheckoutConfiguration): CustomizedTheme;
|
|
@@ -9,4 +9,4 @@ export declare type SubscriptionTabsProps = {
|
|
|
9
9
|
textOverrides: CustomerPortalLocalization;
|
|
10
10
|
theme: CustomerPortalTheme;
|
|
11
11
|
};
|
|
12
|
-
export declare function SubscriptionTabs({ customerPortal, hiddenSections, textOverrides, theme }: SubscriptionTabsProps): JSX.Element | null;
|
|
12
|
+
export declare function SubscriptionTabs({ customerPortal, hiddenSections, textOverrides, theme, }: SubscriptionTabsProps): JSX.Element | null;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { PaywallPlan } from './types';
|
|
2
3
|
import { PriceTierFragment } from '@stigg/js-client-sdk';
|
|
3
|
-
export declare function
|
|
4
|
-
|
|
4
|
+
export declare function TiersLayout({ plan, tiers, tierUnits, selectedTier, handleTierChange, }: {
|
|
5
|
+
plan: PaywallPlan;
|
|
5
6
|
tiers?: PriceTierFragment[] | null;
|
|
6
7
|
tierUnits?: string;
|
|
7
8
|
selectedTier?: PriceTierFragment;
|
|
@@ -17,6 +17,7 @@ export declare type PaywallLocalization = {
|
|
|
17
17
|
};
|
|
18
18
|
price: {
|
|
19
19
|
startingAtCaption: string;
|
|
20
|
+
billingPeriod?: (billingPeriod: BillingPeriod) => string;
|
|
20
21
|
custom: string;
|
|
21
22
|
priceNotSet: string;
|
|
22
23
|
free: PlanPriceText | ((currency?: PaywallCurrency) => PlanPriceText);
|
|
@@ -44,6 +45,7 @@ export declare function getResolvedPaywallLocalize(localizeOverride?: DeepPartia
|
|
|
44
45
|
} | undefined;
|
|
45
46
|
price?: {
|
|
46
47
|
startingAtCaption?: string | undefined;
|
|
48
|
+
billingPeriod?: {} | undefined;
|
|
47
49
|
custom?: string | undefined;
|
|
48
50
|
priceNotSet?: string | undefined;
|
|
49
51
|
free?: {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { PaywallPlan } from '
|
|
1
|
+
import { PaywallPlan } from './types';
|
|
2
2
|
import { BillingPeriod, Price, PriceTierFragment, Subscription } from '@stigg/js-client-sdk';
|
|
3
|
-
export declare function getPriceFeatureUnit(price: Price): string;
|
|
4
|
-
export declare function getTierByQuantity(tiers: PriceTierFragment[], quantity: number): PriceTierFragment | undefined;
|
|
5
3
|
export declare function calculateTierPrice(price: Price, currentTier: PriceTierFragment, selectedBillingPeriod: BillingPeriod, shouldShowMonthlyPriceAmount: boolean): number;
|
|
6
4
|
export declare function getSelectedTier(plan: PaywallPlan, billingPeriod: BillingPeriod, currentSubscription: Subscription | null, selectedTierByFeature: Record<string, PriceTierFragment>): Record<string, PriceTierFragment>;
|
|
7
5
|
export declare enum PriceTierComparison {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Currency } from '@stigg/js-client-sdk';
|
|
2
2
|
export declare const currencyPriceFormatter: ({ amount, currency, locale, maximumFractionDigits, }: {
|
|
3
3
|
amount: number;
|
|
4
|
-
currency?:
|
|
4
|
+
currency?: Currency | undefined;
|
|
5
5
|
locale?: string | undefined;
|
|
6
6
|
maximumFractionDigits?: number | undefined;
|
|
7
7
|
}) => string;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ export * from '@stigg/js-client-sdk';
|
|
|
3
3
|
export { Paywall, PaywallProps, OnPlanSelectedCallbackFn, PaywallPlan, SubscribeIntentionType, PaywallLocalization, } from './components/paywall';
|
|
4
4
|
export { CustomerPortalProvider, CustomerPortal, CustomerPortalProps, CustomerPortalSection, AddonsList, PaymentDetailsSection, InvoicesSection, CustomerUsageData, CustomerUsageDataProps, SubscriptionsOverview, SubscriptionsOverviewProps, Promotions, } from './components/customerPortal';
|
|
5
5
|
export { StiggProvider, StiggProviderProps, useStiggContext, StiggContextValue, StiggContext, } from './components/StiggProvider';
|
|
6
|
-
export { Checkout, CheckoutProps, CheckoutTheme } from './components/checkout';
|
|
7
6
|
export { useWaitForCheckoutCompleted, ProvisionStatus } from './components/hooks';
|
|
8
7
|
export { HorizontalAlignment, TextAlignment } from './theme/types';
|
|
9
8
|
export { CustomizedTheme as Theme } from './theme/Theme';
|