@stigg/react-sdk 4.4.0-beta.3 → 4.4.0-beta.5
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/components/checkout/Checkout.d.ts +1 -1
- package/dist/components/checkout/CheckoutContainer.d.ts +6 -2
- package/dist/components/checkout/CheckoutProvider.d.ts +3 -1
- package/dist/components/checkout/components/DowngradeToFreeContainer.d.ts +28 -0
- package/dist/components/checkout/hooks/usePaymentStepModel.d.ts +8 -2
- package/dist/components/checkout/hooks/usePreviewSubscription.d.ts +3 -0
- package/dist/components/checkout/hooks/useProgressBarModel.d.ts +2 -0
- package/dist/components/checkout/hooks/useSubscriptionModel.d.ts +2 -1
- package/dist/components/checkout/index.d.ts +1 -0
- package/dist/components/checkout/steps/payment/PaymentMethods.d.ts +3 -2
- package/dist/components/checkout/steps/payment/PaymentStep.d.ts +2 -1
- package/dist/components/checkout/steps/payment/stripe/StripePaymentForm.d.ts +2 -1
- package/dist/components/checkout/steps/payment/stripe/stripe.utils.d.ts +4 -0
- package/dist/components/checkout/steps/payment/stripe/useSubmit.d.ts +2 -1
- package/dist/components/checkout/steps/plan/CheckoutChargeList.d.ts +6 -1
- package/dist/components/checkout/summary/CheckoutSummary.d.ts +3 -1
- package/dist/components/checkout/summary/components/LineItems.d.ts +2 -2
- package/dist/components/checkout/textOverrides.d.ts +4 -1
- package/dist/components/checkout/types.d.ts +7 -0
- package/dist/components/paywall/paywallTextOverrides.d.ts +4 -0
- package/dist/components/utils/getPaidPriceText.d.ts +3 -1
- package/dist/react-sdk.cjs.development.js +607 -271
- 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 +619 -271
- package/dist/react-sdk.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/assets/payment-method.svg +3 -10
- package/src/components/checkout/Checkout.tsx +3 -1
- package/src/components/checkout/CheckoutContainer.tsx +48 -22
- package/src/components/checkout/CheckoutProvider.tsx +8 -4
- package/src/components/checkout/components/DowngradeToFreeContainer.tsx +98 -0
- package/src/components/checkout/hooks/usePaymentStepModel.ts +22 -3
- package/src/components/checkout/hooks/usePlanStepModel.ts +5 -5
- package/src/components/checkout/hooks/usePreviewSubscription.ts +34 -4
- package/src/components/checkout/hooks/useProgressBarModel.ts +15 -0
- package/src/components/checkout/hooks/useSubscriptionModel.ts +8 -2
- package/src/components/checkout/hooks/useSubscriptionState.ts +2 -1
- package/src/components/checkout/index.ts +1 -0
- package/src/components/checkout/progressBar/CheckoutProgressBar.tsx +3 -2
- package/src/components/checkout/steps/payment/PaymentMethods.tsx +13 -6
- package/src/components/checkout/steps/payment/PaymentStep.tsx +3 -1
- package/src/components/checkout/steps/payment/stripe/StripePaymentForm.tsx +35 -4
- package/src/components/checkout/steps/payment/stripe/stripe.utils.ts +4 -3
- package/src/components/checkout/steps/payment/stripe/useSubmit.ts +54 -45
- package/src/components/checkout/steps/plan/CheckoutChargeList.tsx +41 -10
- package/src/components/checkout/summary/CheckoutSuccess.tsx +1 -1
- package/src/components/checkout/summary/CheckoutSummary.tsx +24 -19
- package/src/components/checkout/summary/components/LineItems.tsx +8 -16
- package/src/components/checkout/textOverrides.ts +5 -4
- package/src/components/checkout/types.ts +9 -0
- package/src/components/paywall/PlanPrice.tsx +10 -2
- package/src/components/paywall/paywallTextOverrides.ts +3 -0
- package/src/components/utils/getPaidPriceText.ts +8 -2
- package/src/components/utils/getPlanPrice.ts +1 -1
- package/dist/components/checkout/steps/surprise/SurpriseStep.d.ts +0 -2
- package/src/assets/nyancat.svg +0 -634
- package/src/components/checkout/steps/surprise/SurpriseStep.tsx +0 -27
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
import { CheckoutProviderProps } from './CheckoutProvider';
|
|
3
3
|
import { CheckoutContainerProps } from './CheckoutContainer';
|
|
4
4
|
export declare type CheckoutProps = CheckoutProviderProps & CheckoutContainerProps;
|
|
5
|
-
export declare const Checkout: ({ textOverrides, theme, resourceId, planId, preferredBillingPeriod, billingCountryCode, billableFeatures, ...containerProps }: CheckoutProps) => JSX.Element;
|
|
5
|
+
export declare const Checkout: ({ textOverrides, theme, resourceId, planId, preferredBillingPeriod, billingCountryCode, billableFeatures, billingInformation, ...containerProps }: CheckoutProps) => JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ApplySubscription, CheckoutStatePlan } from '@stigg/js-client-sdk';
|
|
2
|
+
import { ApplySubscription, BillingAddress, CheckoutStatePlan } from '@stigg/js-client-sdk';
|
|
3
3
|
export declare type CheckoutResult = {
|
|
4
4
|
success: boolean;
|
|
5
5
|
errorMessage?: string;
|
|
@@ -18,5 +18,9 @@ export declare type CheckoutContainerProps = {
|
|
|
18
18
|
onChangePlan?: (params: {
|
|
19
19
|
currentPlan: CheckoutStatePlan | undefined;
|
|
20
20
|
}) => void;
|
|
21
|
+
onBillingAddressChange?: (params: {
|
|
22
|
+
billingAddress: BillingAddress;
|
|
23
|
+
}) => Promise<void>;
|
|
24
|
+
disablePromotionCode?: boolean;
|
|
21
25
|
};
|
|
22
|
-
export declare function CheckoutContainer({ onCheckout, onCheckoutCompleted, onChangePlan }: CheckoutContainerProps): JSX.Element;
|
|
26
|
+
export declare function CheckoutContainer({ onCheckout, onCheckoutCompleted, onChangePlan, onBillingAddressChange, disablePromotionCode, }: CheckoutContainerProps): JSX.Element;
|
|
@@ -5,6 +5,7 @@ import { AddonsStepState, PaymentStepState, PlanStepState, ProgressBarState, Wid
|
|
|
5
5
|
import { CheckoutLocalization } from './textOverrides';
|
|
6
6
|
import { CheckoutTheme } from './theme';
|
|
7
7
|
import { StiggTheme } from '../../theme/types';
|
|
8
|
+
import { BillingInformation } from './types';
|
|
8
9
|
export interface CheckoutContextState {
|
|
9
10
|
checkout?: GetCheckoutStateResults | null;
|
|
10
11
|
checkoutLocalization: CheckoutLocalization;
|
|
@@ -28,7 +29,8 @@ export declare type CheckoutProviderProps = {
|
|
|
28
29
|
preferredBillingPeriod?: BillingPeriod;
|
|
29
30
|
billingCountryCode?: string;
|
|
30
31
|
billableFeatures?: BillableFeature[];
|
|
32
|
+
billingInformation?: BillingInformation;
|
|
31
33
|
};
|
|
32
|
-
export declare function CheckoutProvider({ children, textOverrides, theme, preferredBillingPeriod, billableFeatures, resourceId, planId, billingCountryCode, }: {
|
|
34
|
+
export declare function CheckoutProvider({ children, textOverrides, theme, preferredBillingPeriod, billableFeatures, resourceId, planId, billingCountryCode, billingInformation, }: {
|
|
33
35
|
children: React.ReactNode;
|
|
34
36
|
} & CheckoutProviderProps): JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="@emotion/styled/macro" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { CheckoutStatePlan, Subscription } from '@stigg/js-client-sdk';
|
|
4
|
+
import { Currency, BillingPeriod } from '@stigg/js-client-sdk';
|
|
5
|
+
import { CheckoutLocalization } from '../textOverrides';
|
|
6
|
+
export declare const DowngradeToFreePlanBox: import("@emotion/styled/macro").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
component?: "symbol" | "object" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "slot" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "template" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | React.ComponentClass<any, any> | React.FunctionComponent<any> | undefined;
|
|
9
|
+
ref?: ((instance: unknown) => void) | React.RefObject<unknown> | null | undefined;
|
|
10
|
+
sx?: import("@mui/system").SystemCssProperties<import("@mui/material").Theme> | import("@mui/system").CSSPseudoSelectorProps<import("@mui/material").Theme> | import("@mui/system").CSSSelectorObjectOrCssVariables<import("@mui/material").Theme> | ((theme: import("@mui/material").Theme) => import("@mui/system").SystemStyleObject<import("@mui/material").Theme>) | readonly (boolean | import("@mui/system").SystemCssProperties<import("@mui/material").Theme> | import("@mui/system").CSSPseudoSelectorProps<import("@mui/material").Theme> | import("@mui/system").CSSSelectorObjectOrCssVariables<import("@mui/material").Theme> | ((theme: import("@mui/material").Theme) => import("@mui/system").SystemStyleObject<import("@mui/material").Theme>) | null)[] | null | undefined;
|
|
11
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "slot" | "style" | "title" | "className" | "color" | "translate" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "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" | "children" | "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"> & {
|
|
12
|
+
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
13
|
+
}, "slot" | "title" | "translate" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "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"> & {
|
|
14
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
15
|
+
}, {}, {}>;
|
|
16
|
+
export declare const DowngradeToFreeContent: ({ planName, totalPrice, billingPeriod, }: {
|
|
17
|
+
planName: string;
|
|
18
|
+
totalPrice?: {
|
|
19
|
+
amount: number;
|
|
20
|
+
currency: Currency;
|
|
21
|
+
} | undefined;
|
|
22
|
+
billingPeriod?: BillingPeriod | undefined;
|
|
23
|
+
}) => JSX.Element;
|
|
24
|
+
export declare const DowngradeToFreePlan: ({ checkoutLocalization, activeSubscription, freePlan, }: {
|
|
25
|
+
checkoutLocalization: CheckoutLocalization;
|
|
26
|
+
activeSubscription: Subscription;
|
|
27
|
+
freePlan: CheckoutStatePlan;
|
|
28
|
+
}) => JSX.Element;
|
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
import { Customer } from '@stigg/js-client-sdk';
|
|
1
|
+
import { BillingAddress, Customer } from '@stigg/js-client-sdk';
|
|
2
2
|
export declare type PaymentStepState = {
|
|
3
3
|
useNewPaymentMethod: boolean;
|
|
4
4
|
errorMessage?: string;
|
|
5
|
+
billingAddress?: BillingAddress;
|
|
6
|
+
taxPercentage?: number;
|
|
5
7
|
};
|
|
6
8
|
declare type GetPaymentStepInitialStateProps = {
|
|
7
9
|
customer?: Customer;
|
|
10
|
+
taxPercentage?: number;
|
|
8
11
|
};
|
|
9
|
-
export declare function getPaymentStepInitialState({ customer }: GetPaymentStepInitialStateProps): PaymentStepState;
|
|
12
|
+
export declare function getPaymentStepInitialState({ customer, taxPercentage, }: GetPaymentStepInitialStateProps): PaymentStepState;
|
|
10
13
|
export declare function usePaymentStepModel(): {
|
|
11
14
|
setUseNewPaymentMethod: (useNewPaymentMethod: boolean) => void;
|
|
12
15
|
setErrorMessage: (errorMessage?: string | undefined) => void;
|
|
16
|
+
setBillingAddress: (billingAddress?: BillingAddress | undefined) => void;
|
|
13
17
|
useNewPaymentMethod: boolean;
|
|
14
18
|
errorMessage?: string | undefined;
|
|
19
|
+
billingAddress?: BillingAddress | undefined;
|
|
20
|
+
taxPercentage?: number | undefined;
|
|
15
21
|
};
|
|
16
22
|
export {};
|
|
@@ -3,6 +3,9 @@ export declare const usePreviewSubscriptionAction: () => {
|
|
|
3
3
|
previewSubscriptionAction: ({ promotionCode }?: {
|
|
4
4
|
promotionCode?: string | null | undefined;
|
|
5
5
|
}) => Promise<{
|
|
6
|
+
subscriptionPreview: null;
|
|
7
|
+
errorMessage?: undefined;
|
|
8
|
+
} | {
|
|
6
9
|
subscriptionPreview: SubscriptionPreview | null;
|
|
7
10
|
errorMessage: string | null;
|
|
8
11
|
}>;
|
|
@@ -12,6 +12,7 @@ export declare type ProgressBarState = {
|
|
|
12
12
|
activeStep: number;
|
|
13
13
|
completedSteps: number[];
|
|
14
14
|
steps: CheckoutStep[];
|
|
15
|
+
isDisabled: boolean;
|
|
15
16
|
};
|
|
16
17
|
export declare function getProgressBarInitialState({ availableAddons }: {
|
|
17
18
|
availableAddons?: Addon[];
|
|
@@ -24,4 +25,5 @@ export declare function useProgressBarModel(): {
|
|
|
24
25
|
setActiveStep: (stepNumber: number) => void;
|
|
25
26
|
markStepAsCompleted: (stepNumber: number) => void;
|
|
26
27
|
goNext: () => void;
|
|
28
|
+
setIsDisabled: (isDisabled?: boolean | undefined) => void;
|
|
27
29
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AddonsStepState } from './useAddonsStepModel';
|
|
2
2
|
import { PromotionCodeState } from './useCouponModel';
|
|
3
|
+
import { PaymentStepState } from './usePaymentStepModel';
|
|
3
4
|
import { PlanStepState } from './usePlanStepModel';
|
|
4
|
-
export declare type SubscriptionState = PlanStepState & PromotionCodeState & Pick<AddonsStepState, 'addons'>;
|
|
5
|
+
export declare type SubscriptionState = PlanStepState & PromotionCodeState & Pick<AddonsStepState, 'addons'> & Pick<PaymentStepState, 'billingAddress' | 'taxPercentage'>;
|
|
5
6
|
export declare function useSubscriptionModel(): SubscriptionState;
|
|
@@ -2,3 +2,4 @@ export { CheckoutTheme } from './theme';
|
|
|
2
2
|
export { Checkout, CheckoutProps } from './Checkout';
|
|
3
3
|
export { OnCheckoutCompletedParams, OnCheckoutParams, CheckoutResult } from './CheckoutContainer';
|
|
4
4
|
export { CheckoutLocalization } from './textOverrides';
|
|
5
|
+
export * from './types';
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Customer } from '@stigg/js-client-sdk';
|
|
3
3
|
import { Icons } from '../../../common/Icon';
|
|
4
4
|
import { CheckoutLocalization } from '../../textOverrides';
|
|
5
|
+
import { CheckoutContainerProps } from '../../CheckoutContainer';
|
|
5
6
|
export declare type PaymentMethodLayoutProps = {
|
|
6
7
|
checked: boolean;
|
|
7
8
|
icon: Icons;
|
|
@@ -15,6 +16,6 @@ export declare type PaymentMethodProps = Pick<Customer, 'paymentMethodDetails'>
|
|
|
15
16
|
export declare type NewPaymentMethodProps = Pick<PaymentMethodLayoutProps, 'checked' | 'readOnly'> & {
|
|
16
17
|
onSelect: () => void;
|
|
17
18
|
checkoutLocalization: CheckoutLocalization;
|
|
18
|
-
}
|
|
19
|
+
} & Pick<CheckoutContainerProps, 'onBillingAddressChange'>;
|
|
19
20
|
export declare function ExistingPaymentMethod({ checked, paymentMethodDetails, readOnly, onSelect }: PaymentMethodProps): JSX.Element | null;
|
|
20
|
-
export declare function NewPaymentMethod({ checked, onSelect, readOnly, checkoutLocalization }: NewPaymentMethodProps): JSX.Element;
|
|
21
|
+
export declare function NewPaymentMethod({ checked, onSelect, readOnly, checkoutLocalization, onBillingAddressChange, }: NewPaymentMethodProps): JSX.Element;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
import { CheckoutContainerProps } from '../../CheckoutContainer';
|
|
3
|
+
export declare function PaymentStep({ onBillingAddressChange }: Pick<CheckoutContainerProps, 'onBillingAddressChange'>): JSX.Element;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
import { CheckoutContainerProps } from '../../../CheckoutContainer';
|
|
3
|
+
export declare function StripePaymentForm({ onBillingAddressChange }: Pick<CheckoutContainerProps, 'onBillingAddressChange'>): JSX.Element;
|
|
@@ -6,6 +6,10 @@ declare type StripeElementsProps = {
|
|
|
6
6
|
};
|
|
7
7
|
export declare function handleStripeFormValidations({ elements }: Pick<StripeElementsProps, 'elements'>): Promise<{
|
|
8
8
|
success: boolean;
|
|
9
|
+
errorMessage: string;
|
|
10
|
+
} | {
|
|
11
|
+
success: boolean;
|
|
12
|
+
errorMessage?: undefined;
|
|
9
13
|
}>;
|
|
10
14
|
export declare function handleNewPaymentMethod({ stripe, elements, setupIntentClientSecret, }: {
|
|
11
15
|
stripe: Stripe | null;
|
|
@@ -2,8 +2,9 @@ import { ApplySubscriptionResults } from '@stigg/js-client-sdk';
|
|
|
2
2
|
import { CheckoutContainerProps } from '../../../CheckoutContainer';
|
|
3
3
|
export declare type HandleSubmitResult = {
|
|
4
4
|
results?: ApplySubscriptionResults;
|
|
5
|
+
success: boolean;
|
|
5
6
|
errorMessage?: string;
|
|
6
|
-
}
|
|
7
|
+
};
|
|
7
8
|
export declare type UseSubmitProps = {
|
|
8
9
|
onSuccess?: () => void;
|
|
9
10
|
} & Pick<CheckoutContainerProps, 'onCheckout' | 'onCheckoutCompleted'>;
|
|
@@ -7,10 +7,15 @@ declare type CheckoutChargeListProps = {
|
|
|
7
7
|
plan?: Plan;
|
|
8
8
|
billingPeriod: BillingPeriod;
|
|
9
9
|
};
|
|
10
|
-
export declare function PlanCharge({ charge, setBillableFeature, billableFeature, }: {
|
|
10
|
+
export declare function PlanCharge({ charge, isValid, setBillableFeature, billableFeature, onValidationChange, }: {
|
|
11
11
|
charge: Price;
|
|
12
|
+
isValid: boolean;
|
|
12
13
|
billableFeature?: BillableFeatureInput;
|
|
13
14
|
setBillableFeature: UsePlanStepModel['setBillableFeature'];
|
|
15
|
+
onValidationChange: ({ featureId, isValid }: {
|
|
16
|
+
featureId: string;
|
|
17
|
+
isValid: boolean;
|
|
18
|
+
}) => void;
|
|
14
19
|
}): JSX.Element;
|
|
15
20
|
export declare function CheckoutChargeList({ plan, billingPeriod }: CheckoutChargeListProps): JSX.Element;
|
|
16
21
|
export {};
|
|
@@ -13,4 +13,6 @@ export declare const SummaryCard: import("@emotion/styled/macro").StyledComponen
|
|
|
13
13
|
}, "slot" | "title" | "ref" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "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"> & {
|
|
14
14
|
theme?: import("@emotion/react").Theme | undefined;
|
|
15
15
|
}, {}, {}>;
|
|
16
|
-
export declare const CheckoutSummary: ({ onCheckout, onCheckoutCompleted }: CheckoutContainerProps
|
|
16
|
+
export declare const CheckoutSummary: ({ onCheckout, onCheckoutCompleted, disablePromotionCode, isFreeDowngrade, }: CheckoutContainerProps & {
|
|
17
|
+
isFreeDowngrade: boolean;
|
|
18
|
+
}) => JSX.Element;
|
|
@@ -10,8 +10,8 @@ export declare const LineItemRow: import("@emotion/styled/macro").StyledComponen
|
|
|
10
10
|
theme?: import("@emotion/react").Theme | undefined;
|
|
11
11
|
as?: "symbol" | "object" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "slot" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "template" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | React.ComponentClass<any, any> | React.FunctionComponent<any> | undefined;
|
|
12
12
|
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
13
|
-
export declare const getPriceString: ({
|
|
14
|
-
|
|
13
|
+
export declare const getPriceString: ({ amount, price, quantity }: {
|
|
14
|
+
amount: number;
|
|
15
15
|
price: Price;
|
|
16
16
|
quantity: number;
|
|
17
17
|
}) => string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BillingPeriod, SubscriptionPreviewTaxDetails } from '@stigg/js-client-sdk';
|
|
1
|
+
import { BillingPeriod, Plan, SubscriptionPreviewTaxDetails } from '@stigg/js-client-sdk';
|
|
2
2
|
import { DeepPartial } from '../../types';
|
|
3
3
|
export declare type CheckoutLocalization = {
|
|
4
4
|
changePlan: string;
|
|
@@ -28,5 +28,8 @@ export declare type CheckoutLocalization = {
|
|
|
28
28
|
taxTitle: (params: {
|
|
29
29
|
taxDetails: SubscriptionPreviewTaxDetails;
|
|
30
30
|
}) => string;
|
|
31
|
+
downgradeToFreeAlertText: (params: {
|
|
32
|
+
plan: Plan;
|
|
33
|
+
}) => string;
|
|
31
34
|
};
|
|
32
35
|
export declare function getResolvedCheckoutLocalize(localizeOverride?: DeepPartial<CheckoutLocalization>): CheckoutLocalization;
|
|
@@ -17,6 +17,8 @@ export declare type PaywallLocalization = {
|
|
|
17
17
|
};
|
|
18
18
|
price: {
|
|
19
19
|
startingAtCaption: string;
|
|
20
|
+
billingPeriod?: (billingPeriod: BillingPeriod) => string;
|
|
21
|
+
pricePeriod: (billingPeriod: BillingPeriod) => string;
|
|
20
22
|
custom: string;
|
|
21
23
|
priceNotSet: string;
|
|
22
24
|
free: PlanPriceText | ((currency?: PaywallCurrency) => PlanPriceText);
|
|
@@ -44,6 +46,8 @@ export declare function getResolvedPaywallLocalize(localizeOverride?: DeepPartia
|
|
|
44
46
|
} | undefined;
|
|
45
47
|
price?: {
|
|
46
48
|
startingAtCaption?: string | undefined;
|
|
49
|
+
billingPeriod?: {} | undefined;
|
|
50
|
+
pricePeriod?: {} | undefined;
|
|
47
51
|
custom?: string | undefined;
|
|
48
52
|
priceNotSet?: string | undefined;
|
|
49
53
|
free?: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BillingPeriod, PaywallCalculatedPricePoint, Price, PriceTierFragment } from '@stigg/js-client-sdk';
|
|
2
2
|
import { PlanPriceText } from './getPlanPrice';
|
|
3
|
+
import { PaywallLocalization } from '../paywall';
|
|
3
4
|
declare type GetPaidPriceTextParams = {
|
|
4
5
|
planPrices: Price[];
|
|
5
6
|
paywallCalculatedPrice?: PaywallCalculatedPricePoint;
|
|
@@ -7,6 +8,7 @@ declare type GetPaidPriceTextParams = {
|
|
|
7
8
|
locale: string;
|
|
8
9
|
shouldShowMonthlyPriceAmount: boolean;
|
|
9
10
|
selectedTierByFeature: Record<string, PriceTierFragment>;
|
|
11
|
+
paywallLocale: PaywallLocalization;
|
|
10
12
|
};
|
|
11
|
-
export declare function getPaidPriceText({ planPrices, paywallCalculatedPrice, selectedBillingPeriod, locale, shouldShowMonthlyPriceAmount, selectedTierByFeature, }: GetPaidPriceTextParams): PlanPriceText;
|
|
13
|
+
export declare function getPaidPriceText({ planPrices, paywallCalculatedPrice, selectedBillingPeriod, locale, shouldShowMonthlyPriceAmount, selectedTierByFeature, paywallLocale, }: GetPaidPriceTextParams): PlanPriceText;
|
|
12
14
|
export {};
|