@stigg/react-sdk 4.3.0-beta.0 → 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.
Files changed (170) hide show
  1. package/README.md +1 -1
  2. package/dist/components/common/Icon.d.ts +2 -3
  3. package/dist/components/common/PoweredByStigg.d.ts +1 -1
  4. package/dist/components/common/customIcons.d.ts +5 -17
  5. package/dist/components/common/mapExternalTheme.d.ts +0 -2
  6. package/dist/components/customerPortal/subscriptionOverview/tabs/SubscriptionTabs.d.ts +1 -1
  7. package/dist/components/{common/TiersSelectContainer.d.ts → paywall/TiersLayout.d.ts} +3 -2
  8. package/dist/components/paywall/paywallTextOverrides.d.ts +2 -0
  9. package/dist/components/{utils/priceTierUtils.d.ts → paywall/planPriceTier.d.ts} +1 -3
  10. package/dist/components/utils/calculateDiscountRate.d.ts +0 -1
  11. package/dist/components/utils/currencyUtils.d.ts +1 -1
  12. package/dist/index.d.ts +0 -1
  13. package/dist/react-sdk.cjs.development.js +201 -3447
  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 +207 -3590
  18. package/dist/react-sdk.esm.js.map +1 -1
  19. package/dist/theme/getResolvedTheme.d.ts +0 -1
  20. package/dist/theme/types.d.ts +0 -1
  21. package/package.json +22 -11
  22. package/src/components/StiggProvider.tsx +2 -0
  23. package/src/components/common/Icon.tsx +22 -17
  24. package/src/components/common/PoweredByStigg.tsx +1 -1
  25. package/src/components/common/Typography.tsx +1 -11
  26. package/src/components/common/customIcons.ts +28 -17
  27. package/src/components/common/mapExternalTheme.ts +0 -6
  28. package/src/components/customerPortal/subscriptionOverview/tabs/SubscriptionTabs.tsx +12 -6
  29. package/src/components/paywall/Paywall.tsx +1 -1
  30. package/src/components/paywall/PlanOffering.tsx +1 -1
  31. package/src/components/paywall/PlanOfferingButton.tsx +1 -1
  32. package/src/components/paywall/PlanPrice.tsx +13 -5
  33. package/src/components/{common/TiersSelectContainer.tsx → paywall/TiersLayout.tsx} +7 -8
  34. package/src/components/paywall/paywallTextOverrides.ts +1 -0
  35. package/src/components/{utils/priceTierUtils.ts → paywall/planPriceTier.ts} +3 -25
  36. package/src/components/paywall/utils/calculateUnitQuantityText.ts +4 -9
  37. package/src/components/utils/calculateDiscountRate.ts +1 -1
  38. package/src/components/utils/currencyUtils.ts +1 -1
  39. package/src/components/utils/getPaidPriceText.ts +2 -2
  40. package/src/index.ts +0 -1
  41. package/src/stories/CustomerPortal.stories.tsx +11 -11
  42. package/src/stories/Paywall.stories.tsx +4 -6
  43. package/src/stories/baseArgs.ts +1 -1
  44. package/src/theme/Fonts.tsx +1 -1
  45. package/src/theme/Theme.tsx +7 -9
  46. package/src/theme/getResolvedTheme.ts +0 -1
  47. package/src/theme/types.ts +0 -1
  48. package/dist/components/checkout/Checkout.d.ts +0 -5
  49. package/dist/components/checkout/CheckoutContainer.d.ts +0 -22
  50. package/dist/components/checkout/CheckoutContainer.style.d.ts +0 -29
  51. package/dist/components/checkout/CheckoutProvider.d.ts +0 -33
  52. package/dist/components/checkout/CheckoutSummary.d.ts +0 -9
  53. package/dist/components/checkout/components/Button.d.ts +0 -6
  54. package/dist/components/checkout/components/InputField.d.ts +0 -8
  55. package/dist/components/checkout/components/index.d.ts +0 -2
  56. package/dist/components/checkout/formatting.d.ts +0 -2
  57. package/dist/components/checkout/hooks/index.d.ts +0 -8
  58. package/dist/components/checkout/hooks/useAddonsStepModel.d.ts +0 -21
  59. package/dist/components/checkout/hooks/useCheckoutModel.d.ts +0 -9
  60. package/dist/components/checkout/hooks/useCouponModel.d.ts +0 -7
  61. package/dist/components/checkout/hooks/useLoadCheckout.d.ts +0 -13
  62. package/dist/components/checkout/hooks/usePaymentStepModel.d.ts +0 -16
  63. package/dist/components/checkout/hooks/usePlanStepModel.d.ts +0 -23
  64. package/dist/components/checkout/hooks/usePreviewSubscription.d.ts +0 -13
  65. package/dist/components/checkout/hooks/useProgressBarModel.d.ts +0 -26
  66. package/dist/components/checkout/hooks/useSubscriptionModel.d.ts +0 -5
  67. package/dist/components/checkout/hooks/useSubscriptionState.d.ts +0 -2
  68. package/dist/components/checkout/index.d.ts +0 -3
  69. package/dist/components/checkout/planHeader/PlanHeader.d.ts +0 -7
  70. package/dist/components/checkout/planHeader/PlanHeader.style.d.ts +0 -25
  71. package/dist/components/checkout/planHeader/index.d.ts +0 -1
  72. package/dist/components/checkout/progressBar/CheckoutProgressBar.d.ts +0 -2
  73. package/dist/components/checkout/progressBar/CheckoutProgressBar.style.d.ts +0 -45
  74. package/dist/components/checkout/promotionCode/AddPromotionCode.d.ts +0 -5
  75. package/dist/components/checkout/promotionCode/AddPromotionCodeButton.d.ts +0 -7
  76. package/dist/components/checkout/promotionCode/AppliedPromotionCode.d.ts +0 -6
  77. package/dist/components/checkout/promotionCode/PromotionCodeSection.d.ts +0 -5
  78. package/dist/components/checkout/promotionCode/index.d.ts +0 -1
  79. package/dist/components/checkout/steps/addons/CheckoutAddonsStep.d.ts +0 -2
  80. package/dist/components/checkout/steps/addons/CheckoutAddonsStep.style.d.ts +0 -93
  81. package/dist/components/checkout/steps/addons/addon.utils.d.ts +0 -15
  82. package/dist/components/checkout/steps/addons/index.d.ts +0 -1
  83. package/dist/components/checkout/steps/payment/PaymentMethods.d.ts +0 -19
  84. package/dist/components/checkout/steps/payment/PaymentMethods.style.d.ts +0 -113
  85. package/dist/components/checkout/steps/payment/PaymentStep.d.ts +0 -2
  86. package/dist/components/checkout/steps/payment/index.d.ts +0 -1
  87. package/dist/components/checkout/steps/payment/stripe/StripePaymentForm.d.ts +0 -2
  88. package/dist/components/checkout/steps/payment/stripe/index.d.ts +0 -3
  89. package/dist/components/checkout/steps/payment/stripe/stripe.utils.d.ts +0 -33
  90. package/dist/components/checkout/steps/payment/stripe/useStripeIntegration.d.ts +0 -5
  91. package/dist/components/checkout/steps/payment/stripe/useSubmit.d.ts +0 -10
  92. package/dist/components/checkout/steps/plan/BillingPeriodPicker.d.ts +0 -9
  93. package/dist/components/checkout/steps/plan/BillingPeriodPicker.style.d.ts +0 -52
  94. package/dist/components/checkout/steps/plan/CheckoutChargeList.d.ts +0 -16
  95. package/dist/components/checkout/steps/plan/CheckoutPlanStep.d.ts +0 -4
  96. package/dist/components/checkout/steps/plan/CheckoutPlanStep.style.d.ts +0 -12
  97. package/dist/components/checkout/steps/plan/index.d.ts +0 -1
  98. package/dist/components/checkout/steps/surprise/SurpriseStep.d.ts +0 -2
  99. package/dist/components/checkout/textOverrides.d.ts +0 -28
  100. package/dist/components/checkout/theme.d.ts +0 -8
  101. package/dist/components/checkout/types.d.ts +0 -7
  102. package/dist/components/hooks/useChargeSort.d.ts +0 -3
  103. package/dist/components/utils/priceUtils.d.ts +0 -2
  104. package/dist/stories/Checkout.stories.d.ts +0 -3
  105. package/src/assets/arrow-forward.svg +0 -3
  106. package/src/assets/arrow-right.svg +0 -6
  107. package/src/assets/close.svg +0 -3
  108. package/src/assets/nyancat.svg +0 -634
  109. package/src/assets/outlined-checked-circle.svg +0 -6
  110. package/src/assets/outlined-circle.svg +0 -3
  111. package/src/assets/payment-method.svg +0 -11
  112. package/src/assets/plus-icon.svg +0 -6
  113. package/src/assets/trash.svg +0 -8
  114. package/src/components/checkout/Checkout.tsx +0 -30
  115. package/src/components/checkout/CheckoutContainer.style.ts +0 -34
  116. package/src/components/checkout/CheckoutContainer.tsx +0 -92
  117. package/src/components/checkout/CheckoutProvider.tsx +0 -135
  118. package/src/components/checkout/CheckoutSummary.tsx +0 -361
  119. package/src/components/checkout/components/Button.tsx +0 -30
  120. package/src/components/checkout/components/InputField.tsx +0 -23
  121. package/src/components/checkout/components/index.ts +0 -2
  122. package/src/components/checkout/formatting.ts +0 -12
  123. package/src/components/checkout/hooks/index.ts +0 -8
  124. package/src/components/checkout/hooks/useAddonsStepModel.ts +0 -96
  125. package/src/components/checkout/hooks/useCheckoutModel.ts +0 -31
  126. package/src/components/checkout/hooks/useCouponModel.ts +0 -28
  127. package/src/components/checkout/hooks/useLoadCheckout.ts +0 -40
  128. package/src/components/checkout/hooks/usePaymentStepModel.ts +0 -49
  129. package/src/components/checkout/hooks/usePlanStepModel.ts +0 -170
  130. package/src/components/checkout/hooks/usePreviewSubscription.ts +0 -82
  131. package/src/components/checkout/hooks/useProgressBarModel.ts +0 -89
  132. package/src/components/checkout/hooks/useSubscriptionModel.ts +0 -16
  133. package/src/components/checkout/hooks/useSubscriptionState.ts +0 -26
  134. package/src/components/checkout/index.ts +0 -3
  135. package/src/components/checkout/planHeader/PlanHeader.style.tsx +0 -23
  136. package/src/components/checkout/planHeader/PlanHeader.tsx +0 -61
  137. package/src/components/checkout/planHeader/index.ts +0 -1
  138. package/src/components/checkout/progressBar/CheckoutProgressBar.style.ts +0 -29
  139. package/src/components/checkout/progressBar/CheckoutProgressBar.tsx +0 -48
  140. package/src/components/checkout/promotionCode/AddPromotionCode.tsx +0 -85
  141. package/src/components/checkout/promotionCode/AddPromotionCodeButton.tsx +0 -39
  142. package/src/components/checkout/promotionCode/AppliedPromotionCode.tsx +0 -37
  143. package/src/components/checkout/promotionCode/PromotionCodeSection.tsx +0 -27
  144. package/src/components/checkout/promotionCode/index.ts +0 -1
  145. package/src/components/checkout/steps/addons/CheckoutAddonsStep.style.tsx +0 -24
  146. package/src/components/checkout/steps/addons/CheckoutAddonsStep.tsx +0 -125
  147. package/src/components/checkout/steps/addons/addon.utils.ts +0 -68
  148. package/src/components/checkout/steps/addons/index.ts +0 -1
  149. package/src/components/checkout/steps/payment/PaymentMethods.style.ts +0 -26
  150. package/src/components/checkout/steps/payment/PaymentMethods.tsx +0 -83
  151. package/src/components/checkout/steps/payment/PaymentStep.tsx +0 -41
  152. package/src/components/checkout/steps/payment/index.ts +0 -1
  153. package/src/components/checkout/steps/payment/stripe/StripePaymentForm.tsx +0 -43
  154. package/src/components/checkout/steps/payment/stripe/index.ts +0 -3
  155. package/src/components/checkout/steps/payment/stripe/stripe.utils.ts +0 -109
  156. package/src/components/checkout/steps/payment/stripe/useStripeIntegration.ts +0 -27
  157. package/src/components/checkout/steps/payment/stripe/useSubmit.ts +0 -100
  158. package/src/components/checkout/steps/plan/BillingPeriodPicker.style.tsx +0 -46
  159. package/src/components/checkout/steps/plan/BillingPeriodPicker.tsx +0 -63
  160. package/src/components/checkout/steps/plan/CheckoutChargeList.tsx +0 -138
  161. package/src/components/checkout/steps/plan/CheckoutPlanStep.style.tsx +0 -6
  162. package/src/components/checkout/steps/plan/CheckoutPlanStep.tsx +0 -22
  163. package/src/components/checkout/steps/plan/index.ts +0 -1
  164. package/src/components/checkout/steps/surprise/SurpriseStep.tsx +0 -27
  165. package/src/components/checkout/textOverrides.ts +0 -58
  166. package/src/components/checkout/theme.ts +0 -26
  167. package/src/components/checkout/types.ts +0 -7
  168. package/src/components/hooks/useChargeSort.ts +0 -17
  169. package/src/components/utils/priceUtils.ts +0 -10
  170. package/src/stories/Checkout.stories.tsx +0 -59
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const SurpriseStep: () => JSX.Element;
@@ -1,28 +0,0 @@
1
- import { BillingPeriod } from '@stigg/js-client-sdk';
2
- import { DeepPartial } from '../../types';
3
- export declare type CheckoutLocalization = {
4
- changePlan: string;
5
- billingPeriodsTitle: string;
6
- addAddonText: string;
7
- newPaymentMethodText: string;
8
- newPaymentMethodCardTitle: string;
9
- newPaymentMethodBillingAddressTitle: string;
10
- baseChargeText: string | ((params: {
11
- billingPeriod: BillingPeriod;
12
- }) => string);
13
- totalText: string;
14
- subTotalText: string;
15
- addCouponCodeText: string;
16
- couponCodeTitle: string;
17
- addonsSectionTitle: string;
18
- changesWillApplyAtEndOfBillingPeriod: string | ((params: {
19
- billingPeriodEnd: Date;
20
- }) => string);
21
- checkoutButton: {
22
- nextText: string;
23
- downgradeText: string;
24
- upgradeText: string;
25
- purchaseText: string;
26
- };
27
- };
28
- export declare function getResolvedCheckoutLocalize(localizeOverride?: DeepPartial<CheckoutLocalization>): CheckoutLocalization;
@@ -1,8 +0,0 @@
1
- import { StiggTheme } from '../../theme/types';
2
- import { DeepPartial } from '../../types';
3
- import { CheckoutConfiguration } from './types';
4
- export declare type CheckoutTheme = {
5
- backgroundColor: string;
6
- borderColor: string;
7
- };
8
- export declare function getResolvedCheckoutTheme(_globalTheme: StiggTheme, themeOverride?: DeepPartial<CheckoutTheme>, remoteConfiguration?: CheckoutConfiguration | null): CheckoutTheme;
@@ -1,7 +0,0 @@
1
- /** placeholder types until we have backend support **/
2
- export declare type CheckoutConfiguration = {
3
- palette?: {
4
- backgroundColor: string;
5
- borderColor: string;
6
- };
7
- };
@@ -1,3 +0,0 @@
1
- import { Price } from '@stigg/js-client-sdk';
2
- export declare const sortCharges: (charges: Price[]) => Price[];
3
- export declare const useChargesSort: (charges: Price[]) => Price[];
@@ -1,2 +0,0 @@
1
- import { Price } from '@stigg/js-client-sdk';
2
- export declare const getValidPriceQuantity: (price: Price, quantity: number) => number;
@@ -1,3 +0,0 @@
1
- declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react").ReactFramework, import("../components/checkout").CheckoutProps>;
2
- export default _default;
3
- export declare const DefaultCheckout: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, any>;
@@ -1,3 +0,0 @@
1
- <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M9 3L7.9425 4.0575L12.1275 8.25H3V9.75H12.1275L7.9425 13.9425L9 15L15 9L9 3Z" fill="white"/>
3
- </svg>
@@ -1,6 +0,0 @@
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>
@@ -1,3 +0,0 @@
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>