@stigg/react-sdk 5.35.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/components/common/customIcons.d.ts +3 -0
  2. package/dist/components/paywall/Paywall.d.ts +2 -1
  3. package/dist/components/paywall/PaywallContainer.d.ts +2 -1
  4. package/dist/components/paywall/PlanCompatibleAddons.d.ts +15 -0
  5. package/dist/components/paywall/PlanOffering.d.ts +2 -1
  6. package/dist/components/paywall/index.d.ts +1 -0
  7. package/dist/components/paywall/paywallTextOverrides.d.ts +2 -0
  8. package/dist/react-sdk.cjs.development.js +1636 -1421
  9. package/dist/react-sdk.cjs.development.js.map +1 -1
  10. package/dist/react-sdk.cjs.production.min.js +1 -1
  11. package/dist/react-sdk.cjs.production.min.js.map +1 -1
  12. package/dist/react-sdk.esm.js +4608 -4351
  13. package/dist/react-sdk.esm.js.map +1 -1
  14. package/dist/stories/Paywall.stories.d.ts +1 -0
  15. package/package.json +3 -3
  16. package/src/assets/add.svg +3 -0
  17. package/src/assets/check.svg +1 -1
  18. package/src/assets/entitlement-check.svg +3 -0
  19. package/src/assets/remove.svg +3 -0
  20. package/src/components/checkout/summary/CheckoutSuccess.tsx +7 -12
  21. package/src/components/common/customIcons.ts +3 -0
  22. package/src/components/paywall/EntitlementRow.tsx +8 -10
  23. package/src/components/paywall/Paywall.tsx +3 -0
  24. package/src/components/paywall/PaywallContainer.tsx +3 -0
  25. package/src/components/paywall/PlanCompatibleAddons.tsx +125 -0
  26. package/src/components/paywall/PlanEntitlements.tsx +1 -1
  27. package/src/components/paywall/PlanOffering.tsx +13 -0
  28. package/src/components/paywall/index.ts +1 -0
  29. package/src/components/paywall/paywallTextOverrides.ts +2 -0
  30. package/src/stories/Paywall.stories.tsx +16 -0
@@ -19,3 +19,6 @@ export { default as Close } from '../../assets/close.svg';
19
19
  export { default as Check } from '../../assets/check.svg';
20
20
  export { default as PayAsYouGoCharge } from '../../assets/pay-as-you-go-charge.svg';
21
21
  export { default as Coupon } from '../../assets/coupon.svg';
22
+ export { default as Add } from '../../assets/add.svg';
23
+ export { default as Remove } from '../../assets/remove.svg';
24
+ export { default as EntitlementCheck } from '../../assets/entitlement-check.svg';
@@ -17,6 +17,7 @@ declare type PaywallProps = {
17
17
  locale: string;
18
18
  shouldHidePlan?: ShouldHidePlanFn;
19
19
  selectDefaultTierIndex?: SelectDefaultTierIndexFn;
20
+ hideCompatibleAddons?: boolean;
20
21
  };
21
- export declare const Paywall: ({ plans, customer, currentSubscription, highlightedPlanId, selectedBillingPeriod, onBillingPeriodChanged, availableBillingPeriods, isCustomerOnTrial, onPlanSelected, paywallLocale, locale, shouldHidePlan, selectDefaultTierIndex, currentSubscriptionOverride, }: PaywallProps) => JSX.Element;
22
+ export declare const Paywall: ({ plans, customer, currentSubscription, highlightedPlanId, selectedBillingPeriod, onBillingPeriodChanged, availableBillingPeriods, isCustomerOnTrial, onPlanSelected, paywallLocale, locale, shouldHidePlan, selectDefaultTierIndex, currentSubscriptionOverride, hideCompatibleAddons, }: PaywallProps) => JSX.Element;
22
23
  export {};
@@ -15,6 +15,7 @@ export declare type PaywallContainerProps = {
15
15
  billingCountryCode?: string;
16
16
  shouldHidePlan?: ShouldHidePlanFn;
17
17
  selectDefaultTierIndex?: SelectDefaultTierIndexFn;
18
+ hideCompatibleAddons?: boolean;
18
19
  currentSubscriptionOverride?: CurrentSubscriptionOverrideFn;
19
20
  };
20
- export declare const PaywallContainer: ({ productId, resourceId, highlightedPlanId, showOnlyEligiblePlans, textOverrides, onPlanSelected, preferredBillingPeriod, onBillingPeriodChange, billingCountryCode, shouldHidePlan, selectDefaultTierIndex, currentSubscriptionOverride: currentSubscriptionOverrideFn, }: PaywallContainerProps) => JSX.Element;
21
+ export declare const PaywallContainer: ({ productId, resourceId, highlightedPlanId, showOnlyEligiblePlans, textOverrides, onPlanSelected, preferredBillingPeriod, onBillingPeriodChange, billingCountryCode, shouldHidePlan, selectDefaultTierIndex, currentSubscriptionOverride: currentSubscriptionOverrideFn, hideCompatibleAddons, }: PaywallContainerProps) => JSX.Element;
@@ -0,0 +1,15 @@
1
+ /// <reference types="@emotion/styled/macro" />
2
+ import React from 'react';
3
+ import { Addon } from '@stigg/js-client-sdk';
4
+ import { PaywallLocalization } from './paywallTextOverrides';
5
+ export declare const StyledButton: import("@emotion/styled/macro").StyledComponent<import("@mui/material/Button").ButtonOwnProps & Pick<import("@mui/material").ButtonBaseOwnProps, "action" | "centerRipple" | "children" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "tabIndex" | "TouchRippleProps" | "touchRippleRef"> & import("@mui/material/OverridableComponent").CommonProps & Pick<Pick<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "form" | "slot" | "style" | "title" | "className" | "children" | "disabled" | "tabIndex" | "key" | "type" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "value"> & {
6
+ ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
7
+ }, "form" | "slot" | "title" | "ref" | "key" | "type" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "value"> & {
8
+ theme?: import("@emotion/react").Theme | undefined;
9
+ }, {}, {}>;
10
+ declare type PlanCompatibleAddonsProps = {
11
+ addons: Addon[];
12
+ paywallLocale: PaywallLocalization;
13
+ };
14
+ export declare function PlanCompatibleAddons({ addons, paywallLocale }: PlanCompatibleAddonsProps): JSX.Element | null;
15
+ export {};
@@ -22,6 +22,7 @@ declare type PlanOfferingProps = {
22
22
  withStartingAtRow: boolean;
23
23
  isCustomerInCustomPlan: boolean;
24
24
  selectDefaultTierIndex?: SelectDefaultTierIndexFn;
25
+ hideCompatibleAddons?: boolean;
25
26
  };
26
- export declare function PlanOffering({ withUnitPriceRow, withTiersRow, withTrialLeftRow, customer, plan, billingPeriod, isHighlighted, currentSubscription, currentSubscriptionOverride, shouldShowDescriptionSection, hasMonthlyPrice, hasAnnuallyPrice, isCustomerOnTrial, onPlanSelected, paywallLocale, locale, withStartingAtRow, isCustomerInCustomPlan, selectDefaultTierIndex, }: PlanOfferingProps): JSX.Element;
27
+ export declare function PlanOffering({ withUnitPriceRow, withTiersRow, withTrialLeftRow, customer, plan, billingPeriod, isHighlighted, currentSubscription, currentSubscriptionOverride, shouldShowDescriptionSection, hasMonthlyPrice, hasAnnuallyPrice, isCustomerOnTrial, onPlanSelected, paywallLocale, locale, withStartingAtRow, isCustomerInCustomPlan, selectDefaultTierIndex, hideCompatibleAddons, }: PlanOfferingProps): JSX.Element;
27
28
  export {};
@@ -1,3 +1,4 @@
1
1
  export { PaywallContainer as Paywall, PaywallContainerProps as PaywallProps } from './PaywallContainer';
2
2
  export * from './types';
3
3
  export { PaywallLocalization, PlanPriceText, CurrentPlanParams } from './paywallTextOverrides';
4
+ export { PlanCompatibleAddons } from './PlanCompatibleAddons';
@@ -10,6 +10,7 @@ export declare type CurrentPlanParams = {
10
10
  export declare type PaywallLocalization = {
11
11
  highlightChip: string;
12
12
  entitlementsTitle?: (plan: PaywallPlan) => string;
13
+ addonsTitle?: string;
13
14
  planCTAButton: {
14
15
  upgrade: string | ((plan: PaywallPlan) => string);
15
16
  downgrade: string | ((plan: PaywallPlan) => string);
@@ -39,6 +40,7 @@ export declare type PaywallLocalization = {
39
40
  export declare function getResolvedPaywallLocalize(localizeOverride?: DeepPartial<PaywallLocalization>): PaywallLocalization & {
40
41
  highlightChip?: string | undefined;
41
42
  entitlementsTitle?: {} | undefined;
43
+ addonsTitle?: string | undefined;
42
44
  planCTAButton?: {
43
45
  upgrade?: string | {} | undefined;
44
46
  downgrade?: string | {} | undefined;