@bunnyapp/components 1.0.76-beta.1 → 1.0.76-beta.3

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 (37) hide show
  1. package/dist/cjs/index.js +433 -205
  2. package/dist/cjs/src/components/QuotePreviewProvider.d.ts +17 -0
  3. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/PlanPicker.d.ts +0 -5
  4. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/PriceListGrid.d.ts +2 -2
  5. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/PriceListSelector.d.ts +2 -3
  6. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/CheckoutBarSummarySection.d.ts +1 -3
  7. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/EverythingPlanFeatures.d.ts +62 -2
  8. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/FeatureAddons.d.ts +9 -0
  9. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/PlanFeatures.d.ts +3 -3
  10. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/PriceListGridDesktop.d.ts +2 -2
  11. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerUtils.d.ts +3 -3
  12. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCardPriceDescription.d.ts +7 -0
  13. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/priceListCardUtils.d.ts +3 -2
  14. package/dist/cjs/src/components/Subscriptions/SubscriptionsContext.d.ts +0 -3
  15. package/dist/cjs/src/graphql/mutations/quoteChargeCreate.d.ts +2 -1
  16. package/dist/cjs/src/graphql/mutations/quoteChargeDelete.d.ts +7 -0
  17. package/dist/cjs/src/hooks/quotes/useQuoteUpdateFeatureAddon.d.ts +8 -0
  18. package/dist/cjs/src/utils/featureAddonUtils.d.ts +3 -0
  19. package/dist/esm/index.js +435 -207
  20. package/dist/esm/src/components/QuotePreviewProvider.d.ts +17 -0
  21. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/PlanPicker.d.ts +0 -5
  22. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/PriceListGrid.d.ts +2 -2
  23. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/PriceListSelector.d.ts +2 -3
  24. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/CheckoutBarSummarySection.d.ts +1 -3
  25. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/EverythingPlanFeatures.d.ts +62 -2
  26. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/FeatureAddons.d.ts +9 -0
  27. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/PlanFeatures.d.ts +3 -3
  28. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/PriceListGridDesktop.d.ts +2 -2
  29. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerUtils.d.ts +3 -3
  30. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCardPriceDescription.d.ts +7 -0
  31. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/priceListCardUtils.d.ts +3 -2
  32. package/dist/esm/src/components/Subscriptions/SubscriptionsContext.d.ts +0 -3
  33. package/dist/esm/src/graphql/mutations/quoteChargeCreate.d.ts +2 -1
  34. package/dist/esm/src/graphql/mutations/quoteChargeDelete.d.ts +7 -0
  35. package/dist/esm/src/hooks/quotes/useQuoteUpdateFeatureAddon.d.ts +8 -0
  36. package/dist/esm/src/utils/featureAddonUtils.d.ts +3 -0
  37. package/package.json +2 -2
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ import { PriceList } from '@bunnyapp/common';
3
+ export type QuotePreviewData = {
4
+ priceList?: PriceList;
5
+ quantity?: number;
6
+ editingQuoteId?: string;
7
+ };
8
+ export type QuotePreviewContextValues = {
9
+ quotePreviewData?: QuotePreviewData;
10
+ setQuotePreviewData: React.Dispatch<React.SetStateAction<QuotePreviewData | undefined>>;
11
+ handleSetEditingQuote: (editingQuoteId: string) => void;
12
+ };
13
+ export declare const QuotePreviewContext: import("react").Context<QuotePreviewContextValues>;
14
+ declare function QuotePreviewProvider({ children }: {
15
+ children: React.ReactNode;
16
+ }): import("react/jsx-runtime").JSX.Element;
17
+ export default QuotePreviewProvider;
@@ -1,7 +1,2 @@
1
- import { PriceList } from '@bunnyapp/common';
2
- export type QuotePreviewData = {
3
- priceList?: PriceList;
4
- quantity?: number;
5
- };
6
1
  declare const PlanPicker: () => import("react/jsx-runtime").JSX.Element;
7
2
  export default PlanPicker;
@@ -1,5 +1,5 @@
1
- import { Dispatch, SetStateAction } from "react";
2
- import { PriceListChangeOptions, PriceList, Subscription, Product } from "@bunnyapp/common";
1
+ import { PriceList, PriceListChangeOptions, Product, Subscription } from '@bunnyapp/common';
2
+ import { Dispatch, SetStateAction } from 'react';
3
3
  type PriceListGridProps = {
4
4
  availablePriceLists: PriceList[];
5
5
  onChangePriceList: (selectedPriceList: PriceList) => void;
@@ -1,11 +1,10 @@
1
- import { PriceList, Subscription, PriceListChangeOptions } from "@bunnyapp/common";
2
- declare const PriceListSelector: ({ arePlanChangeOptionsLoading, areSubscriptionsLoading, onChangePriceList, priceListChangeOptions, selectedPriceList, subscriptions, upgradingSubscription, }: {
1
+ import { PriceList, PriceListChangeOptions, Subscription } from '@bunnyapp/common';
2
+ declare const PriceListSelector: ({ arePlanChangeOptionsLoading, areSubscriptionsLoading, onChangePriceList, priceListChangeOptions, selectedPriceList, subscriptions, }: {
3
3
  arePlanChangeOptionsLoading: boolean;
4
4
  areSubscriptionsLoading: boolean;
5
5
  onChangePriceList: (selectedPriceList: PriceList) => void;
6
6
  priceListChangeOptions?: PriceListChangeOptions | undefined;
7
7
  selectedPriceList?: PriceList | undefined;
8
8
  subscriptions: Subscription[];
9
- upgradingSubscription?: Subscription | undefined;
10
9
  }) => import("react/jsx-runtime").JSX.Element;
11
10
  export default PriceListSelector;
@@ -1,11 +1,9 @@
1
1
  import { PriceList, Quote, Subscription } from '@bunnyapp/common';
2
- import { QuotePreviewData } from '../PlanPicker';
3
- declare const CheckoutBarSummarySection: ({ open, quote, selectedPriceList, onClickCheckout, upgradingSubscription, quotePreviewData, }: {
2
+ declare const CheckoutBarSummarySection: ({ open, quote, selectedPriceList, onClickCheckout, upgradingSubscription, }: {
4
3
  open: boolean;
5
4
  quote?: Quote | undefined;
6
5
  selectedPriceList: PriceList;
7
6
  onClickCheckout: () => void;
8
7
  upgradingSubscription?: Subscription | undefined;
9
- quotePreviewData?: QuotePreviewData | undefined;
10
8
  }) => import("react/jsx-runtime").JSX.Element;
11
9
  export default CheckoutBarSummarySection;
@@ -1,6 +1,66 @@
1
- import { PriceList, Product } from '@bunnyapp/common';
2
- declare const EverythingPlanFeatures: ({ availablePriceLists, selectedProduct, plansToDisplay, }: {
1
+ import { PlanFeature, PriceList, Product } from '@bunnyapp/common';
2
+ export declare const filterUniqueFeatures: ({ availablePriceLists, }: {
3
3
  availablePriceLists: PriceList[];
4
+ }) => {
5
+ plan: {
6
+ planFeatures: PlanFeature[] | undefined;
7
+ addon?: boolean | undefined;
8
+ availableFrom?: string | undefined;
9
+ availableTo?: string | undefined;
10
+ basePrice?: number | undefined;
11
+ code?: string | undefined;
12
+ contactUsLabel?: string | undefined;
13
+ contactUsUrl?: string | undefined;
14
+ createdAt: string;
15
+ description?: string | undefined;
16
+ features?: import("@bunnyapp/common").Feature[] | undefined;
17
+ id: string;
18
+ internalNotes?: string | undefined;
19
+ isAvailableNow?: boolean | undefined;
20
+ isVisible?: boolean | undefined;
21
+ name: string;
22
+ position: number;
23
+ priceLists: PriceList[];
24
+ pricingDescription?: string | undefined;
25
+ pricingStyle: import("@bunnyapp/common").PricingStyle;
26
+ product: Product;
27
+ productId: string;
28
+ selfServiceBuy?: boolean | undefined;
29
+ selfServiceCancel?: boolean | undefined;
30
+ selfServiceRenew?: boolean | undefined;
31
+ trialEndDate?: string | undefined;
32
+ updatedAt: string;
33
+ };
34
+ basePrice: number;
35
+ charges: import("@bunnyapp/common").PriceListCharge[];
36
+ code?: string | undefined;
37
+ createdAt: string;
38
+ currency?: import("@bunnyapp/common").Currency | undefined;
39
+ currencyId: string;
40
+ id: string;
41
+ isVisible?: boolean | undefined;
42
+ monthlyBasePrice: number;
43
+ name: string;
44
+ periodMonths: 0 | 1 | 3 | 6 | 12;
45
+ planId: string;
46
+ priceAdjustmentAction?: import("@bunnyapp/common").PriceAdjustmentAction | undefined;
47
+ priceAdjustmentActionOptions?: string[] | undefined;
48
+ priceAdjustmentPercentage?: number | undefined;
49
+ priceAdjustmentTiming?: import("@bunnyapp/common").PriceAdjustmentTiming | undefined;
50
+ priceAdjustmentTimingOptions?: string[] | undefined;
51
+ priceDescription?: string | undefined;
52
+ product: Product;
53
+ productId?: string | undefined;
54
+ renewalTermMonths?: number | undefined;
55
+ showPriceAsMonthly?: boolean | undefined;
56
+ sku?: string | undefined;
57
+ trialAllowed: boolean;
58
+ trialExpirationAction?: ("CANCEL" | "ACTIVATE") | undefined;
59
+ trialLengthDays?: number | undefined;
60
+ updatedAt: string;
61
+ }[];
62
+ declare const EverythingPlanFeatures: ({ displayPriceLists, selectedProduct, plansToDisplay, }: {
63
+ displayPriceLists: PriceList[];
4
64
  plansToDisplay: number;
5
65
  selectedProduct?: Product | undefined;
6
66
  }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { PriceList } from '@bunnyapp/common';
2
+ declare const PlanFeatureAddons: ({ displayPriceLists, plansToDisplay, }: {
3
+ displayPriceLists: PriceList[];
4
+ plansToDisplay: number;
5
+ }) => import("react/jsx-runtime").JSX.Element;
6
+ export declare function FeatureAddonsList({ priceList }: {
7
+ priceList: PriceList;
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ export default PlanFeatureAddons;
@@ -1,6 +1,6 @@
1
- import { Plan, Product } from '@bunnyapp/common';
2
- declare const PlanFeatures: ({ availablePlansArray, selectedProduct, plansToDisplay, }: {
3
- availablePlansArray: Plan[];
1
+ import { PriceList, Product } from '@bunnyapp/common';
2
+ declare const PlanFeatures: ({ displayPriceLists, selectedProduct, plansToDisplay, }: {
3
+ displayPriceLists: PriceList[];
4
4
  plansToDisplay: number;
5
5
  selectedProduct?: Product | undefined;
6
6
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
- import { PriceList, PriceListChangeOptions, Product, Subscription } from "@bunnyapp/common";
2
- import { Dispatch, SetStateAction } from "react";
1
+ import { PriceList, PriceListChangeOptions, Product, Subscription } from '@bunnyapp/common';
2
+ import { Dispatch, SetStateAction } from 'react';
3
3
  type PriceListGridDesktopProps = {
4
4
  availablePriceLists: PriceList[];
5
5
  onChangePriceList: (selectedPriceList: PriceList) => void;
@@ -1,13 +1,13 @@
1
- import { PriceList, PriceListChangeOptions } from "@bunnyapp/common";
1
+ import { PriceList, PriceListChangeOptions } from '@bunnyapp/common';
2
2
  export declare const getAvailablePlansAndPriceLists: ({ availablePriceLists, priceListChangeOptions, priceListStart, plansToDisplay, }: {
3
3
  availablePriceLists: PriceList[];
4
4
  priceListChangeOptions?: PriceListChangeOptions | undefined;
5
5
  priceListStart: number;
6
6
  plansToDisplay: number;
7
7
  }) => {
8
- availablePlansArray: import("@bunnyapp/common").Plan[];
8
+ availablePriceListsArray: PriceList[];
9
9
  displayPriceLists: PriceList[];
10
10
  };
11
- export declare const everythingInPlusString: ({ priceList, }: {
11
+ export declare const everythingInPlusString: ({ priceList }: {
12
12
  priceList: PriceList;
13
13
  }) => string;
@@ -1,6 +1,13 @@
1
1
  import { Feature, PriceList } from '@bunnyapp/common';
2
+ import { PeriodMonths } from '../../../../../utils/pricePickerUtils';
2
3
  declare const PriceListCardPriceDescription: ({ feature, priceList, }: {
3
4
  feature?: Feature | undefined;
4
5
  priceList: PriceList;
5
6
  }) => import("react/jsx-runtime").JSX.Element | null;
7
+ export declare function PriceDescriptionString({ unitName, showPriceAsMonthly, periodMonths, doesPlanHaveFlatFeeCharges, }: {
8
+ unitName?: string;
9
+ showPriceAsMonthly?: boolean;
10
+ periodMonths: PeriodMonths;
11
+ doesPlanHaveFlatFeeCharges: boolean;
12
+ }): string;
6
13
  export default PriceListCardPriceDescription;
@@ -1,10 +1,11 @@
1
- import { PriceList, PriceListCharge, Subscription } from "@bunnyapp/common";
1
+ import { PriceList, PriceListCharge, Subscription } from '@bunnyapp/common';
2
2
  export declare const createPlanDescription: (priceList: PriceList) => string;
3
3
  export declare const getActivePlanPriceData: (priceList?: PriceList, selectedPriceList?: PriceList) => {
4
4
  activeCharge: PriceListCharge | undefined;
5
5
  } | undefined;
6
- export declare const isPriceListDisabled: ({ priceList, subscriptions, upgradingSubscription, }: {
6
+ export declare const isPriceListDisabled: ({ priceList, subscriptions, upgradingSubscription, canPurchaseFeatureAddons, }: {
7
7
  priceList: PriceList;
8
8
  subscriptions?: Subscription[] | undefined;
9
9
  upgradingSubscription: Subscription | undefined;
10
+ canPurchaseFeatureAddons: boolean;
10
11
  }) => boolean;
@@ -1,6 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { Subscription } from '@bunnyapp/common';
3
- import { QuotePreviewData } from './PlanManager/PlanPicker/PlanPicker';
4
3
  export type SubscriptionsContextValues = {
5
4
  gap?: number;
6
5
  shadow?: 'none' | 'sm' | 'md' | 'lg';
@@ -14,8 +13,6 @@ export type SubscriptionsContextValues = {
14
13
  setUpgradingSubscription: React.Dispatch<React.SetStateAction<Subscription | undefined>>;
15
14
  updatingChargeQuantityId?: string;
16
15
  setUpdatingChargeQuantityId: React.Dispatch<React.SetStateAction<string | undefined>>;
17
- quotePreviewData?: QuotePreviewData;
18
- setQuotePreviewData: React.Dispatch<React.SetStateAction<QuotePreviewData | undefined>>;
19
16
  subscriptionUpgradeId: string | null;
20
17
  setSubscriptionUpgradeId: React.Dispatch<React.SetStateAction<string | null>>;
21
18
  };
@@ -1,3 +1,4 @@
1
+ import { QuoteCharge } from '@bunnyapp/common';
1
2
  type QuoteChangeCreateChargeProps = {
2
3
  apiHost: string;
3
4
  price?: number;
@@ -8,5 +9,5 @@ type QuoteChangeCreateChargeProps = {
8
9
  subscriptionChargeId?: string;
9
10
  token?: string;
10
11
  };
11
- declare const quoteChargeCreate: ({ price, priceListChargeId, quantity, quoteChangeId, startDate, subscriptionChargeId, token, apiHost, }: QuoteChangeCreateChargeProps) => Promise<unknown>;
12
+ declare const quoteChargeCreate: ({ price, priceListChargeId, quantity, quoteChangeId, startDate, subscriptionChargeId, token, apiHost, }: QuoteChangeCreateChargeProps) => Promise<QuoteCharge>;
12
13
  export default quoteChargeCreate;
@@ -0,0 +1,7 @@
1
+ type QuoteChargeDeleteProps = {
2
+ apiHost: string;
3
+ quoteChargeId: string;
4
+ token?: string;
5
+ };
6
+ declare const quoteChargeDelete: ({ quoteChargeId, token, apiHost }: QuoteChargeDeleteProps) => Promise<unknown>;
7
+ export default quoteChargeDelete;
@@ -0,0 +1,8 @@
1
+ import { PriceListCharge } from '@bunnyapp/common';
2
+ export declare const useQuoteUpdateFeatureAddon: (quoteId: string | undefined, featureAddon: PriceListCharge) => {
3
+ handleAddFeatureAddon: () => void;
4
+ handleRemoveFeatureAddon: () => void;
5
+ isPending: boolean;
6
+ isChecked: boolean;
7
+ editingQuoteLoaded: boolean;
8
+ };
@@ -0,0 +1,3 @@
1
+ import { PriceList, PriceListCharge, Subscription } from '@bunnyapp/common';
2
+ export declare function isAddonPurchased(featureAddon: PriceListCharge, currentSubscription: Subscription | undefined): boolean;
3
+ export declare function priceListHasUnpurchasedFeatureAddons(priceList: PriceList, currentSubscription: Subscription | undefined): boolean;