@stigg/react-sdk 4.10.0 → 4.11.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 (61) hide show
  1. package/dist/components/checkout/hooks/useAddonsStepModel.d.ts +2 -2
  2. package/dist/components/checkout/steps/addons/addon.utils.d.ts +3 -3
  3. package/dist/components/common/LongText.d.ts +3 -4
  4. package/dist/components/customerPortal/CustomerPortal.d.ts +1 -1
  5. package/dist/components/customerPortal/billing/InformationGrid.d.ts +1 -1
  6. package/dist/components/customerPortal/hooks/useCustomerPortal.d.ts +2 -2
  7. package/dist/components/customerPortal/subscriptionOverview/SubscriptionsOverviewHeader.d.ts +0 -2
  8. package/dist/components/paywall/hooks/useLoadPaywallData.d.ts +2 -2
  9. package/dist/components/paywall/utils/hasPricePoints.d.ts +2 -2
  10. package/dist/components/utils/getFeatureName.d.ts +1 -1
  11. package/dist/components/utils/getPlanPrice.d.ts +1 -2
  12. package/dist/components/utils/priceTierUtils.d.ts +1 -1
  13. package/dist/react-sdk.cjs.development.js +98 -72
  14. package/dist/react-sdk.cjs.development.js.map +1 -1
  15. package/dist/react-sdk.cjs.production.min.js +1 -1
  16. package/dist/react-sdk.cjs.production.min.js.map +1 -1
  17. package/dist/react-sdk.esm.js +98 -72
  18. package/dist/react-sdk.esm.js.map +1 -1
  19. package/package.json +1 -1
  20. package/src/components/checkout/CheckoutContainer.tsx +2 -0
  21. package/src/components/checkout/components/Button.tsx +4 -2
  22. package/src/components/checkout/hooks/useAddonsStepModel.ts +2 -2
  23. package/src/components/checkout/steps/addons/addon.utils.ts +26 -26
  24. package/src/components/common/LongText.tsx +2 -4
  25. package/src/components/common/PoweredByStigg.tsx +1 -1
  26. package/src/components/common/Typography.tsx +1 -1
  27. package/src/components/customerPortal/CustomerPortal.tsx +1 -1
  28. package/src/components/customerPortal/CustomerPortalProvider.tsx +1 -0
  29. package/src/components/customerPortal/billing/InformationGrid.tsx +1 -1
  30. package/src/components/customerPortal/billing/PaymentDetailsSection.tsx +3 -3
  31. package/src/components/customerPortal/common/ExternalLinkButton.tsx +1 -1
  32. package/src/components/customerPortal/common/SectionTitle.tsx +2 -2
  33. package/src/components/customerPortal/hooks/useCustomerPortal.ts +3 -3
  34. package/src/components/customerPortal/subscriptionOverview/ContactCustomerSupport.tsx +4 -2
  35. package/src/components/customerPortal/subscriptionOverview/SubscriptionsOverview.tsx +2 -1
  36. package/src/components/customerPortal/subscriptionOverview/SubscriptionsOverviewHeader.tsx +1 -3
  37. package/src/components/customerPortal/subscriptionOverview/charges/ChargeItem.tsx +2 -2
  38. package/src/components/customerPortal/subscriptionOverview/charges/ChargeList.tsx +2 -2
  39. package/src/components/customerPortal/subscriptionOverview/subscriptionScheduledUpdates/SubscriptionScheduledUpdateRow.tsx +1 -1
  40. package/src/components/customerPortal/subscriptionOverview/subscriptionScheduledUpdates/SubscriptionScheduledUpdatesAlert.tsx +2 -2
  41. package/src/components/customerPortal/subscriptionOverview/subscriptionView/SubscriptionView.tsx +1 -1
  42. package/src/components/customerPortal/subscriptionOverview/subscriptionView/TrialPanel.tsx +2 -2
  43. package/src/components/customerPortal/subscriptionOverview/tabs/Promotions.tsx +1 -1
  44. package/src/components/customerPortal/subscriptionOverview/tabs/SubscriptionTabs.tsx +1 -1
  45. package/src/components/customerPortal/subscriptionOverview/upcomingBilling/NextEstimatedBill.tsx +2 -2
  46. package/src/components/customerPortal/subscriptionOverview/upcomingBilling/NoUpcomingBilling.tsx +1 -1
  47. package/src/components/customerPortal/usage/CustomerUsageData.tsx +4 -4
  48. package/src/components/customerPortal/usage/featureUsage/EntitlementCTAButton.tsx +3 -3
  49. package/src/components/customerPortal/usage/featureUsage/FeatureUsage.tsx +3 -3
  50. package/src/components/customerPortal/usage/featureUsage/FeatureUsageProgressBar.tsx +1 -1
  51. package/src/components/hooks/useWaitForCheckoutCompleted.ts +12 -4
  52. package/src/components/paywall/hooks/useLoadPaywallData.ts +4 -4
  53. package/src/components/paywall/utils/computeDefaultBillingPeriod.ts +1 -1
  54. package/src/components/paywall/utils/hasPricePoints.ts +5 -5
  55. package/src/components/utils/getFeatureName.ts +4 -4
  56. package/src/components/utils/getPaidPriceText.ts +4 -4
  57. package/src/components/utils/getPlanPrice.ts +2 -3
  58. package/src/components/utils/getSubscriptionScheduleUpdateTexts.tsx +1 -1
  59. package/src/components/utils/priceTierUtils.ts +13 -13
  60. package/src/components/utils/priceUtils.ts +2 -1
  61. package/src/custom.d.ts +1 -0
@@ -4,13 +4,13 @@ export declare type AddonsStepState = {
4
4
  initialAddons?: SubscriptionAddon[];
5
5
  availableAddons?: Addon[];
6
6
  };
7
- declare type getAddonsStepInitialStateProps = {
7
+ declare type GetAddonsStepInitialStateProps = {
8
8
  plan?: Plan;
9
9
  billingPeriod: BillingPeriod;
10
10
  activeSubscription?: Subscription | null;
11
11
  billingCountryCode?: string;
12
12
  };
13
- export declare function getAddonsStepInitialState({ activeSubscription, plan, billingPeriod, billingCountryCode, }: getAddonsStepInitialStateProps): AddonsStepState;
13
+ export declare function getAddonsStepInitialState({ activeSubscription, plan, billingPeriod, billingCountryCode, }: GetAddonsStepInitialStateProps): AddonsStepState;
14
14
  export declare function useAddonsStepModel(): {
15
15
  setAddon: (addon: Addon, quantity: number) => void;
16
16
  removeAddon: (addonId: string) => void;
@@ -1,5 +1,5 @@
1
1
  import { Addon, BillingPeriod, Currency, SubscriptionAddon } from '@stigg/js-client-sdk';
2
- declare type filterAddonsBaseProps = {
2
+ declare type FilterAddonsBaseProps = {
3
3
  billingPeriod: BillingPeriod;
4
4
  currency: Currency;
5
5
  billingCountryCode?: string;
@@ -8,8 +8,8 @@ export declare const sortAddons: (addons: Addon[]) => Addon[];
8
8
  export declare const sortSubscriptionAddons: (addons: SubscriptionAddon[]) => SubscriptionAddon[];
9
9
  export declare function filterAddons({ addons, billingPeriod, billingCountryCode, currency, }: {
10
10
  addons?: Addon[];
11
- } & filterAddonsBaseProps): Addon[];
11
+ } & FilterAddonsBaseProps): Addon[];
12
12
  export declare function filterSubscriptionAddons({ addons, billingPeriod, billingCountryCode, currency, }: {
13
13
  addons?: SubscriptionAddon[];
14
- } & filterAddonsBaseProps): SubscriptionAddon[];
14
+ } & FilterAddonsBaseProps): SubscriptionAddon[];
15
15
  export {};
@@ -1,7 +1,7 @@
1
- import { CSSProperties, ReactNode } from 'react';
1
+ import React, { CSSProperties, ReactNode } from 'react';
2
2
  import { TooltipProps } from '@mui/material/Tooltip';
3
3
  import { TypographyProps } from './Typography';
4
- export declare const LongText: ({ leaveDelay, children, variant, color, maxLines, wordBreak, bold, tooltipPlacement, className, display, style, ["data-testid"]: dataTestId, }: {
4
+ export declare const LongText: ({ leaveDelay, children, variant, color, maxLines, wordBreak, bold, tooltipPlacement, className, display, style, "data-testid": dataTestId, }: {
5
5
  children: ReactNode;
6
6
  leaveDelay?: number | undefined;
7
7
  variant?: TypographyProps['variant'];
@@ -12,7 +12,6 @@ export declare const LongText: ({ leaveDelay, children, variant, color, maxLines
12
12
  tooltipPlacement?: TooltipProps['placement'];
13
13
  className?: string | undefined;
14
14
  display?: string | undefined;
15
- style?: CSSProperties | undefined;
16
- leftMargin?: boolean | undefined;
15
+ style?: React.CSSProperties | undefined;
17
16
  "data-testid"?: string | undefined;
18
17
  }) => JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
+ import { CustomerPortalSubscription } from '@stigg/js-client-sdk';
2
3
  import { DeepPartial } from '../../types';
3
4
  import { CustomerPortalLocalization } from './customerPortalTextOverrides';
4
5
  import { CustomerPortalTheme } from './customerPortalTheme';
5
- import { CustomerPortalSubscription } from '@stigg/js-client-sdk';
6
6
  import { OnBuyMoreCallbackFn } from './types';
7
7
  export declare type CustomerPortalSection = 'usage' | 'addons' | 'promotionalEntitlements' | 'billingInformation' | 'paymentDetails' | 'invoices';
8
8
  export declare type CustomerPortalProps = {
@@ -1,6 +1,6 @@
1
1
  /// <reference types="@emotion/styled/macro" />
2
- import { TypographyProps } from '../../common/Typography';
3
2
  import React from 'react';
3
+ import { TypographyProps } from '../../common/Typography';
4
4
  export declare const InformationGridContainer: import("@emotion/styled/macro").StyledComponent<{
5
5
  theme?: import("@emotion/react").Theme | undefined;
6
6
  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;
@@ -1,9 +1,9 @@
1
1
  import { CustomerPortal } from '@stigg/js-client-sdk';
2
- declare type useCustomerPortalProps = {
2
+ declare type UseCustomerPortalProps = {
3
3
  resourceId?: string;
4
4
  productId?: string;
5
5
  };
6
- export declare function useCustomerPortal({ resourceId, productId }: useCustomerPortalProps): {
6
+ export declare function useCustomerPortal({ resourceId, productId }: UseCustomerPortalProps): {
7
7
  customerPortal: CustomerPortal | null | undefined;
8
8
  isLoading: boolean;
9
9
  };
@@ -1,8 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { CustomerPortal } from '@stigg/js-client-sdk';
3
2
  import { CustomerPortalLocalization } from '../customerPortalTextOverrides';
4
3
  declare type SubscriptionsOverviewHeaderProps = {
5
- customerPortal?: CustomerPortal | null;
6
4
  onManageSubscription: () => void;
7
5
  hideManageButton: boolean;
8
6
  textOverrides: CustomerPortalLocalization;
@@ -1,11 +1,11 @@
1
1
  import { BillingPeriod } from '@stigg/js-client-sdk';
2
2
  import { PaywallData } from '../types';
3
- declare type useLoadPaywallDataProps = {
3
+ declare type UseLoadPaywallDataProps = {
4
4
  productId?: string;
5
5
  resourceId?: string;
6
6
  showOnlyEligiblePlans?: boolean;
7
7
  billingCountryCode?: string;
8
8
  preferredBillingPeriod?: BillingPeriod;
9
9
  };
10
- export declare function useLoadPaywallData({ productId, resourceId, showOnlyEligiblePlans, billingCountryCode, preferredBillingPeriod, }: useLoadPaywallDataProps): PaywallData;
10
+ export declare function useLoadPaywallData({ productId, resourceId, showOnlyEligiblePlans, billingCountryCode, preferredBillingPeriod, }: UseLoadPaywallDataProps): PaywallData;
11
11
  export {};
@@ -1,4 +1,4 @@
1
- import { PaywallPlan } from '../types';
2
1
  import { BillingPeriod } from '@stigg/js-client-sdk';
3
- export declare function hasPricePointsForPlans(plans: PaywallPlan[], billingPeriod: BillingPeriod): boolean;
2
+ import { PaywallPlan } from '../types';
4
3
  export declare function hasPricePoints(plan: PaywallPlan, billingPeriod: BillingPeriod): boolean;
4
+ export declare function hasPricePointsForPlans(plans: PaywallPlan[], billingPeriod: BillingPeriod): boolean;
@@ -1,3 +1,3 @@
1
1
  import { FeatureFragment } from '@stigg/api-client-js/src/generated/sdk';
2
- export declare function getFeatureDisplayName(feature: FeatureFragment): string;
3
2
  export declare function getFeatureDisplayNameText(featureDisplayName: string, featureUnits: string | undefined | null, featureUnitsPlural: string | undefined | null): string;
3
+ export declare function getFeatureDisplayName(feature: FeatureFragment): string;
@@ -1,6 +1,5 @@
1
1
  import { BillingPeriod, PriceTierFragment } from '@stigg/js-client-sdk';
2
- import { PaywallPlan } from '../paywall';
3
- import { PaywallLocalization } from '../paywall';
2
+ import { PaywallPlan, PaywallLocalization } from '../paywall';
4
3
  export declare type PlanPriceText = {
5
4
  price: string;
6
5
  unit?: string;
@@ -1,5 +1,5 @@
1
- import { PaywallPlan } from '../paywall/types';
2
1
  import { BillingPeriod, Price, PriceTierFragment, Subscription } from '@stigg/js-client-sdk';
2
+ import { PaywallPlan } from '../paywall/types';
3
3
  export declare function getPriceFeatureUnit(price: Price): string;
4
4
  export declare function getTierByQuantity(tiers: PriceTierFragment[], quantity: number): PriceTierFragment | undefined;
5
5
  export declare function calculateTierPrice(price: Price, currentTier: PriceTierFragment, selectedBillingPeriod: BillingPeriod, shouldShowMonthlyPriceAmount: boolean): number;