@bunnyapp/components 1.6.0-beta.1 → 1.6.0-beta.11
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/README.md +71 -0
- package/dist/cjs/index.js +2811 -2381
- package/dist/cjs/types/src/components/Checkout/Checkout.d.ts +18 -3
- package/dist/cjs/types/src/components/Checkout/QuoteCheckout.d.ts +77 -3
- package/dist/cjs/types/src/components/Checkout/checkoutUtils.d.ts +4 -2
- package/dist/cjs/types/src/components/FeatureUsageGraph.d.ts +4 -3
- package/dist/cjs/types/src/components/QuoteProvider/QuoteProvider.d.ts +4 -0
- package/dist/cjs/types/src/components/{QuoteProvider.d.ts → QuoteProvider/context/QuoteContext.d.ts} +4 -6
- package/dist/cjs/types/src/components/QuoteProvider/fragments/quoteFragment.d.ts +142 -0
- package/dist/cjs/types/src/components/QuoteProvider/hooks/useQuoteCreate.d.ts +19 -0
- package/dist/{esm/types/src/hooks/quotes → cjs/types/src/components/QuoteProvider/hooks}/useQuoteQuantities.d.ts +4 -2
- package/dist/cjs/types/src/{graphql → components/QuoteProvider}/mutations/quoteChargeUpdate.d.ts +12 -2
- package/dist/cjs/types/src/components/QuoteProvider/queries/getQuote.d.ts +16 -0
- package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/PriceListGrid.d.ts +2 -1
- package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/checkoutBar/CheckoutBarInput.d.ts +2 -2
- package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/BillingPeriodSelector.d.ts +3 -2
- package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/PlanAddonsCard.d.ts +2 -1
- package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/PriceListGridDesktop.d.ts +3 -2
- package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/util.d.ts +1 -1
- package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceDescription/PriceListCardPriceDescription.d.ts +6 -0
- package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceDescription/utils/hasMultipleRecurringCharges.d.ts +2 -0
- package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/QuantityChangeGridRow.d.ts +2 -3
- package/dist/{esm/types/src/components/Subscriptions/QuantityDrawerContainer.d.ts → cjs/types/src/components/Subscriptions/quantityChangeDrawer/QuantityDrawer.d.ts} +4 -4
- package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/QuantityInput.d.ts +3 -11
- package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/fragments/QuantityDrawerQuoteFragment.d.ts +10 -0
- package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/hooks/useQuoteQueryData.d.ts +3 -0
- package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/hooks/useSetQuoteQueryData.d.ts +5 -0
- package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/quantityChangeDrawerDesktop/QuantityChangeDrawerDesktop.d.ts +0 -2
- package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/queries/quoteChargeCreate.d.ts +23 -0
- package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/queries/quoteChargeUpdate.d.ts +12 -0
- package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/queries/quoteSubscriptionUpdate.d.ts +22 -0
- package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/utils/formatDateForApi.d.ts +2 -0
- package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/{utils.d.ts → utils/utils.d.ts} +0 -9
- package/dist/cjs/types/src/components/Subscriptions/subscriptionsList/SubscriptionsNavigation.d.ts +1 -1
- package/dist/cjs/types/src/components/Subscriptions/subscriptionsList/subscriptionUtils.d.ts +0 -2
- package/dist/cjs/types/src/components/Subscriptions/tieredDisplayDropdown/TieredDisplayDropdown.d.ts +9 -0
- package/dist/cjs/types/src/components/Subscriptions/tieredDisplayDropdown/util.d.ts +9 -0
- package/dist/cjs/types/src/components/TaxationForm.d.ts +3 -3
- package/dist/cjs/types/src/components/priceListPricing/PricingTooltip.d.ts +40 -0
- package/dist/cjs/types/src/components/priceListPricing/components/ChargePriceTiers.d.ts +23 -0
- package/dist/cjs/types/src/components/priceListPricing/components/PriceTierPrice.d.ts +7 -0
- package/dist/cjs/types/src/components/priceListPricing/components/PriceTierRow.d.ts +13 -0
- package/dist/cjs/types/src/components/priceListPricing/misc/consts.d.ts +1 -0
- package/dist/cjs/types/src/components/priceListPricing/types/PriceTier.d.ts +4 -0
- package/dist/cjs/types/src/components/priceListPricing/utils/getPricingModelDescription.d.ts +2 -0
- package/dist/cjs/types/src/components/priceListPricing/utils/getPricingModelTitle.d.ts +2 -0
- package/dist/cjs/types/src/components/priceListPricing/utils/hasPriceTiers.d.ts +9 -0
- package/dist/cjs/types/src/components/priceListPricing/utils/priceListChargeUtil.ts/getFirstTierPrice.d.ts +7 -0
- package/dist/cjs/types/src/enums/SubscriptionState.d.ts +9 -0
- package/dist/cjs/types/src/graphql/QuoteRequests.d.ts +0 -5
- package/dist/cjs/types/src/graphql/mutations/quoteChargeDelete.d.ts +11 -2
- package/dist/cjs/types/src/graphql/queries/getQuote.d.ts +29 -2
- package/dist/cjs/types/src/graphql-codegen/exportedScalarTypes.d.ts +6 -0
- package/dist/cjs/types/src/index.d.ts +2 -2
- package/dist/cjs/types/src/utils/addonPlanUtils.d.ts +2 -1
- package/dist/cjs/types/src/utils/featureAddonUtils.d.ts +16 -1
- package/dist/cjs/types/src/utils/formatCurrency.d.ts +1 -0
- package/dist/cjs/types/src/utils/priceListUtils/doesPriceListHaveFlatFeeCharges.d.ts +7 -0
- package/dist/cjs/types/src/utils/priceListUtils/getPrice.d.ts +5 -0
- package/dist/cjs/types/src/utils/priceListUtils/priceDescription.d.ts +6 -0
- package/dist/cjs/types/src/utils/priceListUtils/priceListPriceText.d.ts +12 -0
- package/dist/cjs/types/src/utils/pricePickerUtils.d.ts +3 -3
- package/dist/esm/index.js +2849 -2419
- package/dist/esm/types/src/components/Checkout/Checkout.d.ts +18 -3
- package/dist/esm/types/src/components/Checkout/QuoteCheckout.d.ts +77 -3
- package/dist/esm/types/src/components/Checkout/checkoutUtils.d.ts +4 -2
- package/dist/esm/types/src/components/FeatureUsageGraph.d.ts +4 -3
- package/dist/esm/types/src/components/QuoteProvider/QuoteProvider.d.ts +4 -0
- package/dist/esm/types/src/components/{QuoteProvider.d.ts → QuoteProvider/context/QuoteContext.d.ts} +4 -6
- package/dist/esm/types/src/components/QuoteProvider/fragments/quoteFragment.d.ts +142 -0
- package/dist/esm/types/src/components/QuoteProvider/hooks/useQuoteCreate.d.ts +19 -0
- package/dist/{cjs/types/src/hooks/quotes → esm/types/src/components/QuoteProvider/hooks}/useQuoteQuantities.d.ts +4 -2
- package/dist/esm/types/src/{graphql → components/QuoteProvider}/mutations/quoteChargeUpdate.d.ts +12 -2
- package/dist/esm/types/src/components/QuoteProvider/queries/getQuote.d.ts +16 -0
- package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/PriceListGrid.d.ts +2 -1
- package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/checkoutBar/CheckoutBarInput.d.ts +2 -2
- package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/BillingPeriodSelector.d.ts +3 -2
- package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/PlanAddonsCard.d.ts +2 -1
- package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/PriceListGridDesktop.d.ts +3 -2
- package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/util.d.ts +1 -1
- package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceDescription/PriceListCardPriceDescription.d.ts +6 -0
- package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceDescription/utils/hasMultipleRecurringCharges.d.ts +2 -0
- package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/QuantityChangeGridRow.d.ts +2 -3
- package/dist/{cjs/types/src/components/Subscriptions/QuantityDrawerContainer.d.ts → esm/types/src/components/Subscriptions/quantityChangeDrawer/QuantityDrawer.d.ts} +4 -4
- package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/QuantityInput.d.ts +3 -11
- package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/fragments/QuantityDrawerQuoteFragment.d.ts +10 -0
- package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/hooks/useQuoteQueryData.d.ts +3 -0
- package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/hooks/useSetQuoteQueryData.d.ts +5 -0
- package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/quantityChangeDrawerDesktop/QuantityChangeDrawerDesktop.d.ts +0 -2
- package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/queries/quoteChargeCreate.d.ts +23 -0
- package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/queries/quoteChargeUpdate.d.ts +12 -0
- package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/queries/quoteSubscriptionUpdate.d.ts +22 -0
- package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/utils/formatDateForApi.d.ts +2 -0
- package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/{utils.d.ts → utils/utils.d.ts} +0 -9
- package/dist/esm/types/src/components/Subscriptions/subscriptionsList/SubscriptionsNavigation.d.ts +1 -1
- package/dist/esm/types/src/components/Subscriptions/subscriptionsList/subscriptionUtils.d.ts +0 -2
- package/dist/esm/types/src/components/Subscriptions/tieredDisplayDropdown/TieredDisplayDropdown.d.ts +9 -0
- package/dist/esm/types/src/components/Subscriptions/tieredDisplayDropdown/util.d.ts +9 -0
- package/dist/esm/types/src/components/TaxationForm.d.ts +3 -3
- package/dist/esm/types/src/components/priceListPricing/PricingTooltip.d.ts +40 -0
- package/dist/esm/types/src/components/priceListPricing/components/ChargePriceTiers.d.ts +23 -0
- package/dist/esm/types/src/components/priceListPricing/components/PriceTierPrice.d.ts +7 -0
- package/dist/esm/types/src/components/priceListPricing/components/PriceTierRow.d.ts +13 -0
- package/dist/esm/types/src/components/priceListPricing/misc/consts.d.ts +1 -0
- package/dist/esm/types/src/components/priceListPricing/types/PriceTier.d.ts +4 -0
- package/dist/esm/types/src/components/priceListPricing/utils/getPricingModelDescription.d.ts +2 -0
- package/dist/esm/types/src/components/priceListPricing/utils/getPricingModelTitle.d.ts +2 -0
- package/dist/esm/types/src/components/priceListPricing/utils/hasPriceTiers.d.ts +9 -0
- package/dist/esm/types/src/components/priceListPricing/utils/priceListChargeUtil.ts/getFirstTierPrice.d.ts +7 -0
- package/dist/esm/types/src/enums/SubscriptionState.d.ts +9 -0
- package/dist/esm/types/src/graphql/QuoteRequests.d.ts +0 -5
- package/dist/esm/types/src/graphql/mutations/quoteChargeDelete.d.ts +11 -2
- package/dist/esm/types/src/graphql/queries/getQuote.d.ts +29 -2
- package/dist/esm/types/src/graphql-codegen/exportedScalarTypes.d.ts +6 -0
- package/dist/esm/types/src/index.d.ts +2 -2
- package/dist/esm/types/src/utils/addonPlanUtils.d.ts +2 -1
- package/dist/esm/types/src/utils/featureAddonUtils.d.ts +16 -1
- package/dist/esm/types/src/utils/formatCurrency.d.ts +1 -0
- package/dist/esm/types/src/utils/priceListUtils/doesPriceListHaveFlatFeeCharges.d.ts +7 -0
- package/dist/esm/types/src/utils/priceListUtils/getPrice.d.ts +5 -0
- package/dist/esm/types/src/utils/priceListUtils/priceDescription.d.ts +6 -0
- package/dist/esm/types/src/utils/priceListUtils/priceListPriceText.d.ts +12 -0
- package/dist/esm/types/src/utils/pricePickerUtils.d.ts +3 -3
- package/package.json +2 -2
- package/dist/cjs/types/src/components/Subscriptions/TieredDisplayDropdown.d.ts +0 -8
- package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceListCardPriceDescription.d.ts +0 -13
- package/dist/cjs/types/src/hooks/quotes/useQuoteCreate.d.ts +0 -9
- package/dist/esm/types/src/components/Subscriptions/TieredDisplayDropdown.d.ts +0 -8
- package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceListCardPriceDescription.d.ts +0 -13
- package/dist/esm/types/src/hooks/quotes/useQuoteCreate.d.ts +0 -9
- /package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/{PriceListCardDesktop.d.ts → priceListCardDesktop/PriceListCardDesktop.d.ts} +0 -0
- /package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/{PriceListCardDesktop.d.ts → priceListCardDesktop/PriceListCardDesktop.d.ts} +0 -0
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { Quote } from '@bunnyapp/common';
|
|
2
1
|
import { FragmentOf } from 'gql.tada';
|
|
3
|
-
import { EditingSubscriptionType } from './QuantityInput';
|
|
4
2
|
export declare const CanShowQuantitiesInput_SubscriptionChargeFragment: import("gql.tada").TadaDocumentNode<{
|
|
5
3
|
id: string | null;
|
|
6
4
|
pricingModel: "FLAT" | "TIERED" | "VOLUME" | "BANDS" | null;
|
|
@@ -27,13 +25,6 @@ export declare const CanShowQuantitiesInput_SubscriptionFragment: import("gql.ta
|
|
|
27
25
|
on: "Subscription";
|
|
28
26
|
masked: true;
|
|
29
27
|
}>;
|
|
30
|
-
export declare const createQuoteParams: (quote: Quote, subscriptionQuantity: number, editedSubscription?: EditingSubscriptionType) => {
|
|
31
|
-
charges: {
|
|
32
|
-
id: string;
|
|
33
|
-
quantity: number;
|
|
34
|
-
}[];
|
|
35
|
-
quoteChange: import("@bunnyapp/common").QuoteChange | undefined;
|
|
36
|
-
};
|
|
37
28
|
export declare const getUpdatingChargeQuantityId: (priceListChargeId: string, subscriptionId: string) => string;
|
|
38
29
|
export declare const canShowQuantitiesInput: ({ charge: maskedCharge, subscription: maskedSubscription, }: {
|
|
39
30
|
charge: FragmentOf<typeof CanShowQuantitiesInput_SubscriptionChargeFragment>;
|
package/dist/cjs/types/src/components/Subscriptions/subscriptionsList/SubscriptionsNavigation.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FragmentOf } from 'gql.tada';
|
|
2
|
-
import { CanShowQuantitiesInput_SubscriptionFragment } from '../quantityChangeDrawer/utils';
|
|
2
|
+
import { CanShowQuantitiesInput_SubscriptionFragment } from '../quantityChangeDrawer/utils/utils';
|
|
3
3
|
declare const SubscriptionsNavigation: ({ inactiveSwitchVisible, showInactive, setShowInactive, setQuantityDrawerOpen, subscriptions, }: {
|
|
4
4
|
inactiveSwitchVisible: boolean;
|
|
5
5
|
showInactive: boolean;
|
package/dist/cjs/types/src/components/Subscriptions/subscriptionsList/subscriptionUtils.d.ts
CHANGED
|
@@ -11,6 +11,4 @@ export declare const isSubscriptionTrial: (subscription: Subscription) => boolea
|
|
|
11
11
|
export declare const isSubscriptionTrialExpired: (subscription: Subscription) => boolean;
|
|
12
12
|
export declare const isDiscount: (kind?: QuoteChangeKind) => kind is QuoteChangeKind.DISCOUNT | QuoteChangeKind.FREE_PERIOD_DISCOUNT;
|
|
13
13
|
export declare const hasPriceTiers: (charge: SubscriptionCharge) => boolean;
|
|
14
|
-
export declare const hasMultiplePriceTiers: (charge: SubscriptionCharge) => boolean;
|
|
15
|
-
export declare const getApplicablePriceTier: (charge: SubscriptionCharge, currencyId: string, priceDecimals: number) => string;
|
|
16
14
|
export declare const getUpdatingChargeQuantityId: (charge: SubscriptionCharge, subscription: Subscription) => string;
|
package/dist/cjs/types/src/components/Subscriptions/tieredDisplayDropdown/TieredDisplayDropdown.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PriceTier } from '@bunnyapp/common';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare const TieredDisplayDropdown: ({ priceTiers, currencyId, priceDecimals, truncatedText, }: {
|
|
4
|
+
priceTiers: PriceTier[];
|
|
5
|
+
currencyId: string;
|
|
6
|
+
priceDecimals: number;
|
|
7
|
+
truncatedText: ReactNode;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default TieredDisplayDropdown;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PricingModel } from '../../../graphql-codegen/exportedScalarTypes';
|
|
2
|
+
export declare const getApplicablePriceTier: (charge: {
|
|
3
|
+
priceTiers: {
|
|
4
|
+
starts: number | null;
|
|
5
|
+
price: number | null;
|
|
6
|
+
}[] | null;
|
|
7
|
+
pricingModel: PricingModel | null;
|
|
8
|
+
quantity: number | null;
|
|
9
|
+
}, currencyId: string, priceDecimals: number) => string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Account
|
|
2
|
-
declare const TaxationForm: ({ account,
|
|
1
|
+
import { Account } from '@bunnyapp/common';
|
|
2
|
+
declare const TaxationForm: ({ account, accountId }: {
|
|
3
3
|
account: Account;
|
|
4
|
-
|
|
4
|
+
accountId: string;
|
|
5
5
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export default TaxationForm;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { PlanPricingStyles, PricingModel } from '@/graphql-codegen/exportedScalarTypes';
|
|
2
|
+
import { FragmentOf } from 'gql.tada';
|
|
3
|
+
export declare const PricingTooltip_PriceListChargeFragment: import("gql.tada").TadaDocumentNode<{
|
|
4
|
+
priceListChargeTiers: {
|
|
5
|
+
starts: number | null;
|
|
6
|
+
price: number | null;
|
|
7
|
+
}[] | null;
|
|
8
|
+
pricingModel: "FLAT" | "TIERED" | "VOLUME" | "BANDS" | null;
|
|
9
|
+
feature: {
|
|
10
|
+
unitName: string | null;
|
|
11
|
+
} | null;
|
|
12
|
+
priceDecimals: number | null;
|
|
13
|
+
name: string;
|
|
14
|
+
[$tada.fragmentRefs]: {
|
|
15
|
+
ChargePriceTiers_PriceListChargeFragment: "PriceListCharge";
|
|
16
|
+
};
|
|
17
|
+
}, {}, {
|
|
18
|
+
fragment: "PricingTooltip_PriceListChargeFragment";
|
|
19
|
+
on: "PriceListCharge";
|
|
20
|
+
masked: true;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const PricingTooltip: ({ className, priceListCharges: maskedPriceListCharges, currencyId, priceList, }: {
|
|
23
|
+
className?: string;
|
|
24
|
+
priceListCharges: FragmentOf<typeof PricingTooltip_PriceListChargeFragment>[];
|
|
25
|
+
currencyId: string;
|
|
26
|
+
priceList: {
|
|
27
|
+
showPriceAsMonthly?: boolean;
|
|
28
|
+
periodMonths?: number;
|
|
29
|
+
charges: {
|
|
30
|
+
pricingModel?: PricingModel;
|
|
31
|
+
basePrice?: number;
|
|
32
|
+
}[];
|
|
33
|
+
plan: {
|
|
34
|
+
pricingStyle?: PlanPricingStyles;
|
|
35
|
+
};
|
|
36
|
+
currencyId?: string;
|
|
37
|
+
monthlyBasePrice?: number;
|
|
38
|
+
basePrice?: number;
|
|
39
|
+
};
|
|
40
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FragmentOf } from 'gql.tada';
|
|
2
|
+
export declare const ChargePriceTiers_PriceListChargeFragment: import("gql.tada").TadaDocumentNode<{
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
pricingModel: "FLAT" | "TIERED" | "VOLUME" | "BANDS" | null;
|
|
6
|
+
priceDecimals: number | null;
|
|
7
|
+
priceListChargeTiers: {
|
|
8
|
+
starts: number | null;
|
|
9
|
+
price: number | null;
|
|
10
|
+
[$tada.fragmentRefs]: {
|
|
11
|
+
PriceTierRow_PriceTierFragment: "PriceListChargeTier";
|
|
12
|
+
};
|
|
13
|
+
}[] | null;
|
|
14
|
+
}, {}, {
|
|
15
|
+
fragment: "ChargePriceTiers_PriceListChargeFragment";
|
|
16
|
+
on: "PriceListCharge";
|
|
17
|
+
masked: true;
|
|
18
|
+
}>;
|
|
19
|
+
declare const ChargePriceTiers: ({ charge: maskedCharge, currencyId, }: {
|
|
20
|
+
charge: FragmentOf<typeof ChargePriceTiers_PriceListChargeFragment>;
|
|
21
|
+
currencyId: string;
|
|
22
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export default ChargePriceTiers;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PriceTier } from '../types/PriceTier';
|
|
2
|
+
declare const PriceTierPrice: ({ currencyId, priceDecimals, tier, }: {
|
|
3
|
+
currencyId: string;
|
|
4
|
+
priceDecimals: number;
|
|
5
|
+
tier: PriceTier;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default PriceTierPrice;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FragmentOf } from 'gql.tada';
|
|
2
|
+
export declare const PriceTierRow_PriceTierFragment: import("gql.tada").TadaDocumentNode<{
|
|
3
|
+
starts: number | null;
|
|
4
|
+
}, {}, {
|
|
5
|
+
fragment: "PriceTierRow_PriceTierFragment";
|
|
6
|
+
on: "PriceListChargeTier";
|
|
7
|
+
masked: true;
|
|
8
|
+
}>;
|
|
9
|
+
declare const PriceTierRow: ({ tier: maskedTier, nextTier: maskedNextTier, }: {
|
|
10
|
+
tier: FragmentOf<typeof PriceTierRow_PriceTierFragment> | null;
|
|
11
|
+
nextTier: FragmentOf<typeof PriceTierRow_PriceTierFragment> | null;
|
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default PriceTierRow;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TOOLTIP_BG_COLOR = "#2F353B";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { PricingModel } from '@/graphql-codegen/exportedScalarTypes';
|
|
2
|
+
export declare const getPricingModelDescription: (pricingModel: PricingModel | null) => "" | "units in each tier are priced separately." | "the highest tier reached prices all units." | "the quantity indexes to a flat price.";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PriceTier } from '../types/PriceTier';
|
|
2
|
+
export declare const priceListHasPriceTiers: (priceList: {
|
|
3
|
+
charges: {
|
|
4
|
+
priceListChargeTiers: PriceTier[];
|
|
5
|
+
}[];
|
|
6
|
+
}) => boolean;
|
|
7
|
+
export declare const chargeHasPriceTiers: (charge: {
|
|
8
|
+
priceListChargeTiers: PriceTier[] | null;
|
|
9
|
+
}) => boolean | 0 | undefined;
|
|
@@ -4,11 +4,6 @@ export declare const quoteSubscriptionUpgrade: ({ subscriptionId, priceListId, a
|
|
|
4
4
|
apiHost: string;
|
|
5
5
|
token?: string;
|
|
6
6
|
}) => Promise<unknown>;
|
|
7
|
-
export declare const useCreateSubscriptionQuote: () => (subscriptionIds: string[], apiHost: string, token?: string) => Promise<unknown>;
|
|
8
|
-
export declare const useQuoteChangeUpdate: () => (charges: {
|
|
9
|
-
id: string;
|
|
10
|
-
quantity: number;
|
|
11
|
-
}[], quoteChangeId: string, apiHost: string, token?: string) => Promise<any>;
|
|
12
7
|
export declare const useQuoteDelete: () => (quoteId: string, apiHost: string, token?: string) => Promise<unknown>;
|
|
13
8
|
export declare const quoteSubscriptionAddon: ({ subscriptionId, priceListId, apiHost, token, }: {
|
|
14
9
|
subscriptionId: string;
|
|
@@ -1,8 +1,17 @@
|
|
|
1
|
-
import { QuoteCharge } from '@bunnyapp/common';
|
|
2
1
|
type QuoteChargeDeleteProps = {
|
|
3
2
|
apiHost: string;
|
|
4
3
|
quoteChargeId: string;
|
|
5
4
|
token?: string;
|
|
6
5
|
};
|
|
7
|
-
declare const quoteChargeDelete: ({ quoteChargeId, token, apiHost }: QuoteChargeDeleteProps) => Promise<
|
|
6
|
+
declare const quoteChargeDelete: ({ quoteChargeId, token, apiHost }: QuoteChargeDeleteProps) => Promise<{
|
|
7
|
+
quoteChange: {
|
|
8
|
+
id: string | null;
|
|
9
|
+
quoteId: string;
|
|
10
|
+
quote: {
|
|
11
|
+
[$tada.fragmentRefs]: {
|
|
12
|
+
QuoteContext_QuoteFragment: "Quote";
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
} | null | undefined>;
|
|
8
17
|
export default quoteChargeDelete;
|
|
@@ -1,9 +1,36 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ResultOf } from 'gql.tada';
|
|
2
2
|
export declare const QUOTE_FIELDS: (removeFormattedQuoteField?: boolean) => string;
|
|
3
|
+
declare const query: import("gql.tada").TadaDocumentNode<{
|
|
4
|
+
quote: {
|
|
5
|
+
[$tada.fragmentRefs]: {
|
|
6
|
+
QuoteContext_QuoteFragment: "Quote";
|
|
7
|
+
};
|
|
8
|
+
} | {
|
|
9
|
+
[$tada.fragmentRefs]: {
|
|
10
|
+
QuoteContext_QuoteFragment: "Quote";
|
|
11
|
+
} & {
|
|
12
|
+
FormattedQuoteField_QuoteFragment: "Quote";
|
|
13
|
+
};
|
|
14
|
+
} | null;
|
|
15
|
+
}, {
|
|
16
|
+
removeFormattedQuoteField: boolean;
|
|
17
|
+
id?: string | null | undefined;
|
|
18
|
+
}, void>;
|
|
19
|
+
export type Quote = ResultOf<typeof query>['quote'];
|
|
3
20
|
declare const getQuote: ({ id, token, apiHost, removeFormattedQuoteField, }: {
|
|
4
21
|
id: string;
|
|
5
22
|
token?: string;
|
|
6
23
|
apiHost: string;
|
|
7
24
|
removeFormattedQuoteField?: boolean;
|
|
8
|
-
}) => Promise<
|
|
25
|
+
}) => Promise<{
|
|
26
|
+
[$tada.fragmentRefs]: {
|
|
27
|
+
QuoteContext_QuoteFragment: "Quote";
|
|
28
|
+
};
|
|
29
|
+
} | {
|
|
30
|
+
[$tada.fragmentRefs]: {
|
|
31
|
+
QuoteContext_QuoteFragment: "Quote";
|
|
32
|
+
} & {
|
|
33
|
+
FormattedQuoteField_QuoteFragment: "Quote";
|
|
34
|
+
};
|
|
35
|
+
} | null>;
|
|
9
36
|
export default getQuote;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { graphql } from './graphql';
|
|
2
|
+
export type QuoteChangeKind = ReturnType<typeof graphql.scalar<'QuoteChangeKind'>>;
|
|
3
|
+
export type PricingModel = ReturnType<typeof graphql.scalar<'PricingModel'>>;
|
|
4
|
+
export type BillingPeriod = ReturnType<typeof graphql.scalar<'BillingPeriod'>>;
|
|
5
|
+
export type PlanPricingStyles = ReturnType<typeof graphql.scalar<'PlanPricingStyles'>>;
|
|
6
|
+
export type ChargeType = ReturnType<typeof graphql.scalar<'ChargeType'>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export * from
|
|
1
|
+
import './styles/index.less';
|
|
2
|
+
export * from './components';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Plan, PriceList, Subscription } from '@bunnyapp/common';
|
|
2
|
+
import { BillingPeriod } from '@/graphql-codegen/exportedScalarTypes';
|
|
2
3
|
export declare const ADDON_INDENTATION = 64;
|
|
3
4
|
export declare function findNonAddonSubscriptions(subscriptions: Subscription[]): Subscription[];
|
|
4
5
|
export declare function findAddonSubscriptions(parentSubscription: Subscription, subscriptions: Subscription[]): Subscription[];
|
|
@@ -2,5 +2,20 @@ import { PriceList, PriceListCharge, Quote, Subscription } from '@bunnyapp/commo
|
|
|
2
2
|
export declare function isAddonPurchased(featureAddon: PriceListCharge, currentSubscription: Subscription | undefined): boolean;
|
|
3
3
|
export declare function hasUnpurchasedFeatureAddons(priceList: PriceList, currentSubscription: Subscription | undefined): boolean;
|
|
4
4
|
export declare function findQuoteChangeForFeatureAddon(quote: Quote): import("@bunnyapp/common").QuoteChange | undefined;
|
|
5
|
-
export declare function featureAddonInQuote(selectedPriceList:
|
|
5
|
+
export declare function featureAddonInQuote(selectedPriceList: {
|
|
6
|
+
id: string;
|
|
7
|
+
}, priceListCharge: {
|
|
8
|
+
id: string;
|
|
9
|
+
}, quote?: {
|
|
10
|
+
quoteChanges?: {
|
|
11
|
+
priceList?: {
|
|
12
|
+
id?: string;
|
|
13
|
+
} | null;
|
|
14
|
+
charges?: {
|
|
15
|
+
priceListCharge?: {
|
|
16
|
+
id?: string;
|
|
17
|
+
} | null;
|
|
18
|
+
}[];
|
|
19
|
+
}[] | null;
|
|
20
|
+
} | null): boolean;
|
|
6
21
|
export declare function featureAddonSwitchTestId(featureAddon: PriceListCharge): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatCurrency: (value: number | string | null | undefined, currencyIsoCode: string | undefined, decimals?: number) => string | number;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PlanPricingStyles } from '@/graphql-codegen/exportedScalarTypes';
|
|
2
|
+
export declare function priceListPriceText({ priceList, }: {
|
|
3
|
+
priceList: {
|
|
4
|
+
plan: {
|
|
5
|
+
pricingStyle?: PlanPricingStyles;
|
|
6
|
+
};
|
|
7
|
+
currencyId?: string;
|
|
8
|
+
showPriceAsMonthly?: boolean;
|
|
9
|
+
monthlyBasePrice?: number;
|
|
10
|
+
basePrice?: number;
|
|
11
|
+
};
|
|
12
|
+
}): string | number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const periodMonthsConverter: (period
|
|
1
|
+
import { Plan, Product } from '@bunnyapp/common';
|
|
2
|
+
import { BillingPeriod } from '@/graphql-codegen/exportedScalarTypes';
|
|
3
|
+
export declare const periodMonthsConverter: (period?: number) => "ONCE" | "MONTHLY" | "QUARTERLY" | "SEMI_ANNUAL" | "ANNUAL";
|
|
4
4
|
export declare const billingPeriodConverter: (period?: BillingPeriod) => 1 | 0 | 3 | 6 | 12;
|
|
5
5
|
export declare const createAvailableBillingPeriods: (plans?: Plan[], selectedProduct?: Product) => (0 | 1 | 3 | 6 | 12)[] | undefined;
|