@bunnyapp/components 1.6.0-beta.9.1 → 1.6.0-beta.9.2

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 (95) hide show
  1. package/dist/cjs/index.js +16 -45
  2. package/dist/cjs/types/src/components/Invoice/InvoiceQuoteContext.d.ts +16 -0
  3. package/dist/cjs/types/src/components/PaymentForm/hooks/useHandlePayment.d.ts +25 -0
  4. package/dist/cjs/types/src/components/QuoteProvider/QuoteProvider.d.ts +4 -0
  5. package/dist/cjs/types/src/components/QuoteProvider/context/QuoteContext.d.ts +19 -0
  6. package/dist/cjs/types/src/components/QuoteProvider/fragments/quoteFieldsFragment.d.ts +65 -0
  7. package/dist/cjs/types/src/components/QuoteProvider/fragments/quoteFragment.d.ts +13 -0
  8. package/dist/cjs/types/src/components/QuoteProvider/hooks/useFeatureQuantities.d.ts +12 -0
  9. package/dist/cjs/types/src/components/QuoteProvider/hooks/useQuoteCreate.d.ts +9 -0
  10. package/dist/cjs/types/src/components/QuoteProvider/hooks/useQuoteQuantities.d.ts +11 -0
  11. package/dist/cjs/types/src/components/QuoteProvider/mutations/quoteChangeUpdate.d.ts +12 -0
  12. package/dist/cjs/types/src/components/QuoteProvider/queries/getQuote.d.ts +6 -0
  13. package/dist/cjs/types/src/components/QuoteProvider/utils/getQuantityFromQuoteChange.d.ts +11 -0
  14. package/dist/cjs/types/src/components/QuoteProvider/utils/quoteChangeCanBeEdited.d.ts +4 -0
  15. package/dist/cjs/types/src/components/Subscriptions/SubscriptionsContext.d.ts +18 -0
  16. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/priceListCardDesktop/PriceListCardDesktop.d.ts +15 -0
  17. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceDescription/PriceListCardPriceDescription.d.ts +6 -0
  18. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceDescription/utils/hasMultipleRecurringCharges.d.ts +2 -0
  19. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/QuantityDrawer.d.ts +15 -0
  20. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/fragments/QuantityDrawerQuoteFragment.d.ts +10 -0
  21. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/hooks/useQuoteQueryData.d.ts +3 -0
  22. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/hooks/useSetQuoteQueryData.d.ts +5 -0
  23. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/queries/quoteChargeCreate.d.ts +12 -0
  24. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/queries/quoteChargeUpdate.d.ts +1 -0
  25. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/queries/quoteSubscriptionUpdate.d.ts +1 -0
  26. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/utils/formatDateForApi.d.ts +2 -0
  27. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/utils/utils.d.ts +35 -0
  28. package/dist/cjs/types/src/components/Subscriptions/subscriptionsList/subscriptionCardHeader/SubscriptionCardHeader.d.ts +7 -0
  29. package/dist/cjs/types/src/components/Subscriptions/subscriptionsList/subscriptionCardHeader/components/SubscriptionCardActions.d.ts +21 -0
  30. package/dist/cjs/types/src/components/Subscriptions/subscriptionsList/subscriptionCardHeader/queries/getPriceListChangeOptions.d.ts +5 -0
  31. package/dist/cjs/types/src/components/Subscriptions/tieredDisplayDropdown/TieredDisplayDropdown.d.ts +9 -0
  32. package/dist/cjs/types/src/components/Subscriptions/tieredDisplayDropdown/util.d.ts +9 -0
  33. package/dist/cjs/types/src/components/Transactions/TransactionsListContext.d.ts +28 -0
  34. package/dist/cjs/types/src/components/priceListPricing/PricingTooltip.d.ts +41 -0
  35. package/dist/cjs/types/src/components/priceListPricing/components/ChargePriceTiers.d.ts +23 -0
  36. package/dist/cjs/types/src/components/priceListPricing/components/PriceTierPrice.d.ts +7 -0
  37. package/dist/cjs/types/src/components/priceListPricing/components/PriceTierRow.d.ts +13 -0
  38. package/dist/cjs/types/src/components/priceListPricing/misc/consts.d.ts +1 -0
  39. package/dist/cjs/types/src/components/priceListPricing/types/PriceTier.d.ts +4 -0
  40. package/dist/cjs/types/src/components/priceListPricing/utils/getPricingModelDescription.d.ts +2 -0
  41. package/dist/cjs/types/src/components/priceListPricing/utils/getPricingModelTitle.d.ts +2 -0
  42. package/dist/cjs/types/src/components/priceListPricing/utils/hasPriceTiers.d.ts +9 -0
  43. package/dist/cjs/types/src/components/priceListPricing/utils/priceListChargeUtil.ts/getChargeBasePrice.d.ts +8 -0
  44. package/dist/cjs/types/src/components/priceListPricing/utils/priceListChargeUtil.ts/getFirstTierPrice.d.ts +7 -0
  45. package/dist/cjs/types/src/graphql/queries/getSubscriptions.d.ts +6 -0
  46. package/dist/cjs/types/src/graphql-codegen/exportedScalarTypes.d.ts +6 -0
  47. package/dist/cjs/types/src/utils/pricePickerUtils.d.ts +1 -1
  48. package/dist/esm/index.js +16 -45
  49. package/dist/esm/types/src/components/Invoice/InvoiceQuoteContext.d.ts +16 -0
  50. package/dist/esm/types/src/components/PaymentForm/hooks/useHandlePayment.d.ts +25 -0
  51. package/dist/esm/types/src/components/QuoteProvider/QuoteProvider.d.ts +4 -0
  52. package/dist/esm/types/src/components/QuoteProvider/context/QuoteContext.d.ts +19 -0
  53. package/dist/esm/types/src/components/QuoteProvider/fragments/quoteFieldsFragment.d.ts +65 -0
  54. package/dist/esm/types/src/components/QuoteProvider/fragments/quoteFragment.d.ts +13 -0
  55. package/dist/esm/types/src/components/QuoteProvider/hooks/useFeatureQuantities.d.ts +12 -0
  56. package/dist/esm/types/src/components/QuoteProvider/hooks/useQuoteCreate.d.ts +9 -0
  57. package/dist/esm/types/src/components/QuoteProvider/hooks/useQuoteQuantities.d.ts +11 -0
  58. package/dist/esm/types/src/components/QuoteProvider/mutations/quoteChangeUpdate.d.ts +12 -0
  59. package/dist/esm/types/src/components/QuoteProvider/queries/getQuote.d.ts +6 -0
  60. package/dist/esm/types/src/components/QuoteProvider/utils/getQuantityFromQuoteChange.d.ts +11 -0
  61. package/dist/esm/types/src/components/QuoteProvider/utils/quoteChangeCanBeEdited.d.ts +4 -0
  62. package/dist/esm/types/src/components/Subscriptions/SubscriptionsContext.d.ts +18 -0
  63. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/priceListCardDesktop/PriceListCardDesktop.d.ts +15 -0
  64. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceDescription/PriceListCardPriceDescription.d.ts +6 -0
  65. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceDescription/utils/hasMultipleRecurringCharges.d.ts +2 -0
  66. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/QuantityDrawer.d.ts +15 -0
  67. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/fragments/QuantityDrawerQuoteFragment.d.ts +10 -0
  68. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/hooks/useQuoteQueryData.d.ts +3 -0
  69. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/hooks/useSetQuoteQueryData.d.ts +5 -0
  70. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/queries/quoteChargeCreate.d.ts +12 -0
  71. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/queries/quoteChargeUpdate.d.ts +1 -0
  72. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/queries/quoteSubscriptionUpdate.d.ts +1 -0
  73. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/utils/formatDateForApi.d.ts +2 -0
  74. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/utils/utils.d.ts +35 -0
  75. package/dist/esm/types/src/components/Subscriptions/subscriptionsList/subscriptionCardHeader/SubscriptionCardHeader.d.ts +7 -0
  76. package/dist/esm/types/src/components/Subscriptions/subscriptionsList/subscriptionCardHeader/components/SubscriptionCardActions.d.ts +21 -0
  77. package/dist/esm/types/src/components/Subscriptions/subscriptionsList/subscriptionCardHeader/queries/getPriceListChangeOptions.d.ts +5 -0
  78. package/dist/esm/types/src/components/Subscriptions/tieredDisplayDropdown/TieredDisplayDropdown.d.ts +9 -0
  79. package/dist/esm/types/src/components/Subscriptions/tieredDisplayDropdown/util.d.ts +9 -0
  80. package/dist/esm/types/src/components/Transactions/TransactionsListContext.d.ts +28 -0
  81. package/dist/esm/types/src/components/priceListPricing/PricingTooltip.d.ts +41 -0
  82. package/dist/esm/types/src/components/priceListPricing/components/ChargePriceTiers.d.ts +23 -0
  83. package/dist/esm/types/src/components/priceListPricing/components/PriceTierPrice.d.ts +7 -0
  84. package/dist/esm/types/src/components/priceListPricing/components/PriceTierRow.d.ts +13 -0
  85. package/dist/esm/types/src/components/priceListPricing/misc/consts.d.ts +1 -0
  86. package/dist/esm/types/src/components/priceListPricing/types/PriceTier.d.ts +4 -0
  87. package/dist/esm/types/src/components/priceListPricing/utils/getPricingModelDescription.d.ts +2 -0
  88. package/dist/esm/types/src/components/priceListPricing/utils/getPricingModelTitle.d.ts +2 -0
  89. package/dist/esm/types/src/components/priceListPricing/utils/hasPriceTiers.d.ts +9 -0
  90. package/dist/esm/types/src/components/priceListPricing/utils/priceListChargeUtil.ts/getChargeBasePrice.d.ts +8 -0
  91. package/dist/esm/types/src/components/priceListPricing/utils/priceListChargeUtil.ts/getFirstTierPrice.d.ts +7 -0
  92. package/dist/esm/types/src/graphql/queries/getSubscriptions.d.ts +6 -0
  93. package/dist/esm/types/src/graphql-codegen/exportedScalarTypes.d.ts +6 -0
  94. package/dist/esm/types/src/utils/pricePickerUtils.d.ts +1 -1
  95. package/package.json +1 -1
@@ -0,0 +1,18 @@
1
+ import { Subscription } from '@bunnyapp/common';
2
+ export type SubscriptionsContextValues = {
3
+ gap?: number;
4
+ shadow?: 'none' | 'sm' | 'md' | 'lg';
5
+ showTitle?: boolean;
6
+ className?: string;
7
+ subscriptionProductNameStyle?: React.CSSProperties;
8
+ productId?: string;
9
+ isInPreviewMode: boolean;
10
+ hideExpired?: boolean;
11
+ upgradingSubscription?: Subscription;
12
+ setUpgradingSubscription: React.Dispatch<React.SetStateAction<Subscription | undefined>>;
13
+ updatingChargeQuantityId?: string;
14
+ setUpdatingChargeQuantityId: React.Dispatch<React.SetStateAction<string | undefined>>;
15
+ subscriptionUpgradeId: string | null;
16
+ setSubscriptionUpgradeId: React.Dispatch<React.SetStateAction<string | null>>;
17
+ };
18
+ export declare const SubscriptionsContext: import("react").Context<SubscriptionsContextValues>;
@@ -0,0 +1,15 @@
1
+ import { Feature, PriceList, Subscription } from '@bunnyapp/common';
2
+ declare const PriceListCardDesktop: ({ hideButton, description, disableSelectCurrentPlan, feature, isPriceListCurrentSubscription, isSelected, priceList, subscriptionPlan, trialRemainingDays, noBorder, onClickPriceListCard, }: {
3
+ hideButton?: boolean;
4
+ description: string;
5
+ disableSelectCurrentPlan: boolean;
6
+ feature?: Feature;
7
+ isPriceListCurrentSubscription: boolean;
8
+ isSelected: boolean;
9
+ priceList: PriceList;
10
+ subscriptionPlan?: Subscription;
11
+ trialRemainingDays?: number;
12
+ noBorder?: boolean;
13
+ onClickPriceListCard?: (priceList: PriceList) => void;
14
+ }) => import("react/jsx-runtime").JSX.Element;
15
+ export default PriceListCardDesktop;
@@ -0,0 +1,6 @@
1
+ import { Feature, PriceList } from '@bunnyapp/common';
2
+ declare const PriceListCardPriceDescription: ({ feature, priceList, }: {
3
+ feature?: Feature;
4
+ priceList: PriceList;
5
+ }) => import("react/jsx-runtime").JSX.Element | null;
6
+ export default PriceListCardPriceDescription;
@@ -0,0 +1,2 @@
1
+ import { PriceList } from '@bunnyapp/common';
2
+ export declare const hasMultipleRecurringCharges: (priceList: PriceList) => number;
@@ -0,0 +1,15 @@
1
+ import { FragmentOf } from 'gql.tada';
2
+ import { QuantityDrawerDesktop_SubscriptionFragment } from './quantityChangeDrawerDesktop/QuantityChangeDrawerDesktop';
3
+ export type EditingQuoteDataType = {
4
+ id: string;
5
+ isTrial: boolean;
6
+ };
7
+ interface QuantityDrawerProps {
8
+ subscriptions: (FragmentOf<typeof QuantityDrawerDesktop_SubscriptionFragment> | null)[];
9
+ quantityDrawerOpen: boolean;
10
+ setQuantityDrawerOpen: (open: boolean) => void;
11
+ handlePortalErrors?: (errors: any) => void;
12
+ setShowInactive: (showInactive: boolean) => void;
13
+ }
14
+ export declare const QuantityDrawer: ({ subscriptions, quantityDrawerOpen, setQuantityDrawerOpen, handlePortalErrors, setShowInactive, }: QuantityDrawerProps) => import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -0,0 +1,10 @@
1
+ export declare const QuantityDrawer_QuoteFragment: import("gql.tada").TadaDocumentNode<{
2
+ id: string | null;
3
+ [$tada.fragmentRefs]: {
4
+ Checkout_QuoteFragment: "Quote";
5
+ };
6
+ }, {}, {
7
+ fragment: "QuantityDrawer_QuoteFragment";
8
+ on: "Quote";
9
+ masked: true;
10
+ }>;
@@ -0,0 +1,3 @@
1
+ import { FragmentOf } from 'gql.tada';
2
+ import { QuantityDrawer_QuoteFragment } from '../fragments/QuantityDrawerQuoteFragment';
3
+ export declare const useQuoteQueryData: (quoteId: string | undefined) => FragmentOf<typeof QuantityDrawer_QuoteFragment> | undefined;
@@ -0,0 +1,5 @@
1
+ import { FragmentOf } from 'gql.tada';
2
+ import { QuantityDrawer_QuoteFragment } from '../fragments/QuantityDrawerQuoteFragment';
3
+ export declare const useSetQuoteQueryData: () => {
4
+ setQuoteQueryData: (quoteId: string, maskedQuote: FragmentOf<typeof QuantityDrawer_QuoteFragment> | null) => void;
5
+ };
@@ -0,0 +1,12 @@
1
+ type QuoteChangeCreateChargeProps = {
2
+ apiHost: string;
3
+ price?: number;
4
+ priceListChargeId?: string;
5
+ quantity?: number;
6
+ quoteChangeId: string;
7
+ startDate: string;
8
+ subscriptionChargeId?: string;
9
+ token?: string;
10
+ };
11
+ export declare const quoteChargeCreate: ({ price, priceListChargeId, quantity, quoteChangeId, startDate, subscriptionChargeId, token, apiHost, }: QuoteChangeCreateChargeProps) => Promise<any>;
12
+ export {};
@@ -0,0 +1 @@
1
+ export declare const quoteChargeUpdate: (quoteChargeId: string, quantity: number, apiHost: string, token?: string) => Promise<any>;
@@ -0,0 +1 @@
1
+ export declare const quoteSubscriptionUpdate: (subscriptionIds: string[], apiHost: string, token?: string) => Promise<any>;
@@ -0,0 +1,2 @@
1
+ import { Dayjs } from 'dayjs';
2
+ export declare const formatDateForApi: (date: Dayjs | string) => string;
@@ -0,0 +1,35 @@
1
+ import { FragmentOf } from 'gql.tada';
2
+ export declare const CanShowQuantitiesInput_SubscriptionChargeFragment: import("gql.tada").TadaDocumentNode<{
3
+ id: string | null;
4
+ pricingModel: "FLAT" | "TIERED" | "VOLUME" | "BANDS" | null;
5
+ expired: boolean;
6
+ selfServiceQuantity: boolean | null;
7
+ }, {}, {
8
+ fragment: "CanShowQuantitiesInput_SubscriptionChargeFragment";
9
+ on: "SubscriptionCharge";
10
+ masked: true;
11
+ }>;
12
+ export declare const CanShowQuantitiesInput_SubscriptionFragment: import("gql.tada").TadaDocumentNode<{
13
+ id: string;
14
+ state: "ACTIVE" | "TRIAL" | "CANCELED" | "EXPIRED" | "TRIAL_EXPIRED" | "PENDING";
15
+ priceList: {
16
+ id: string;
17
+ } | null;
18
+ chargeReport: {
19
+ [$tada.fragmentRefs]: {
20
+ CanShowQuantitiesInput_SubscriptionChargeFragment: "SubscriptionCharge";
21
+ };
22
+ }[] | null;
23
+ }, {}, {
24
+ fragment: "CanShowQuantitiesInput_SubscriptionFragment";
25
+ on: "Subscription";
26
+ masked: true;
27
+ }>;
28
+ export declare const getUpdatingChargeQuantityId: (priceListChargeId: string, subscriptionId: string) => string;
29
+ export declare const canShowQuantitiesInput: ({ charge: maskedCharge, subscription: maskedSubscription, }: {
30
+ charge: FragmentOf<typeof CanShowQuantitiesInput_SubscriptionChargeFragment>;
31
+ subscription: FragmentOf<typeof CanShowQuantitiesInput_SubscriptionFragment>;
32
+ }) => boolean | null;
33
+ export declare const canShowChangeQuantities: ({ subscriptions, }: {
34
+ subscriptions: (FragmentOf<typeof CanShowQuantitiesInput_SubscriptionFragment> | null)[];
35
+ }) => boolean;
@@ -0,0 +1,7 @@
1
+ import { Subscription } from '@bunnyapp/common';
2
+ declare const SubscriptionCardHeader: ({ onChangePlanClick, onCancelSubscriptionClick, subscription, }: {
3
+ onChangePlanClick?: (subscription: Subscription) => void;
4
+ onCancelSubscriptionClick?: (subscription: Subscription) => void;
5
+ subscription: Subscription;
6
+ }) => import("react/jsx-runtime").JSX.Element;
7
+ export default SubscriptionCardHeader;
@@ -0,0 +1,21 @@
1
+ import { Subscription } from '@bunnyapp/common';
2
+ import { FragmentOf } from 'gql.tada';
3
+ export declare const SubscriptionCardActions_PriceListChangeOptionsFragment: import("gql.tada").TadaDocumentNode<{
4
+ priceLists: {
5
+ id: string;
6
+ product: {
7
+ id: string;
8
+ } | null;
9
+ }[] | null;
10
+ }, {}, {
11
+ fragment: "SubscriptionCardActions_PriceListChangeOptionsFragment";
12
+ on: "PriceListChangeOptions";
13
+ masked: true;
14
+ }>;
15
+ export declare const SubscriptionCardActions: ({ onChangePlanClick, onCancelSubscriptionClick, priceListChangeOptions: maskedPriceListChangeOptions, subscription, isPaymentMethodLoading, }: {
16
+ onChangePlanClick?: (subscription: Subscription) => void;
17
+ onCancelSubscriptionClick?: (subscription: Subscription) => void;
18
+ priceListChangeOptions?: FragmentOf<typeof SubscriptionCardActions_PriceListChangeOptionsFragment>;
19
+ subscription: Subscription;
20
+ isPaymentMethodLoading: boolean;
21
+ }) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,5 @@
1
+ export declare const getPriceListChangeOptions: ({ apiHost, productId, token, }: {
2
+ apiHost: string;
3
+ productId: string;
4
+ token?: string;
5
+ }) => Promise<any>;
@@ -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;
@@ -0,0 +1,28 @@
1
+ import { Transaction, TransactionKind } from '@bunnyapp/common';
2
+ import { ShadowType } from '../../types/shadowType';
3
+ import { TransactionListColumnType } from './transactionsList/TransactionsListDesktop';
4
+ export type TransactionsContextValues = {
5
+ showSearchBar?: boolean;
6
+ showTitle?: boolean;
7
+ title?: string;
8
+ transactionComponent?: React.ReactNode;
9
+ transactionStateRenderer?: (state: string) => React.ReactNode;
10
+ columns: TransactionListColumnType[];
11
+ className?: string;
12
+ shadow?: ShadowType;
13
+ searchBarClassName?: string;
14
+ useModal?: boolean;
15
+ onTransactionClick?: (transaction: Transaction) => void;
16
+ onTransactionDisplayClose?: (transaction: Transaction | null) => void;
17
+ suppressTransactionDisplay?: boolean;
18
+ kindsToShow?: TransactionKind[];
19
+ style?: React.CSSProperties;
20
+ filter?: string;
21
+ noTransactionsMessage?: string;
22
+ downloadTransactionLink?: (id: string) => string;
23
+ filterTransactions?: (transaction: Transaction) => boolean;
24
+ sortTransactions?: (transactionA: Transaction, transactionB: Transaction) => number;
25
+ transactionDateType: TransactionDateType;
26
+ };
27
+ export type TransactionDateType = 'createdAt' | 'issuedAt' | 'dueAt';
28
+ export declare const TransactionsListContext: import("react").Context<TransactionsContextValues>;
@@ -0,0 +1,41 @@
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
+ basePrice: number;
14
+ name: string;
15
+ [$tada.fragmentRefs]: {
16
+ ChargePriceTiers_PriceListChargeFragment: "PriceListCharge";
17
+ };
18
+ }, {}, {
19
+ fragment: "PricingTooltip_PriceListChargeFragment";
20
+ on: "PriceListCharge";
21
+ masked: true;
22
+ }>;
23
+ export declare const PricingTooltip: ({ className, priceListCharges: maskedPriceListCharges, currencyId, priceList, }: {
24
+ className?: string;
25
+ priceListCharges: FragmentOf<typeof PricingTooltip_PriceListChargeFragment>[];
26
+ currencyId: string;
27
+ priceList: {
28
+ showPriceAsMonthly?: boolean;
29
+ periodMonths?: number;
30
+ charges: {
31
+ pricingModel?: PricingModel;
32
+ basePrice?: number;
33
+ }[];
34
+ plan: {
35
+ pricingStyle?: PlanPricingStyles;
36
+ };
37
+ currencyId?: string;
38
+ monthlyBasePrice?: number;
39
+ basePrice?: number;
40
+ };
41
+ }) => 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,4 @@
1
+ export type PriceTier = {
2
+ starts: number | null;
3
+ price: number | null;
4
+ };
@@ -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,2 @@
1
+ import { PricingModel } from '@/graphql-codegen/exportedScalarTypes';
2
+ export declare const getPricingModelTitle: (pricingModel: PricingModel | null) => "" | "Tiered" | "Volume" | "Bands";
@@ -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;
@@ -0,0 +1,8 @@
1
+ export declare const getChargeBasePrice: (charge: {
2
+ priceListChargeTiers: {
3
+ starts: number | null;
4
+ price: number | null;
5
+ }[] | null;
6
+ priceDecimals: number | null;
7
+ basePrice: number;
8
+ }, currencyId: string) => any;
@@ -0,0 +1,7 @@
1
+ export declare const getFirstTierPrice: (charge: {
2
+ priceListChargeTiers: {
3
+ starts: number | null;
4
+ price: number | null;
5
+ }[] | null;
6
+ priceDecimals: number | null;
7
+ }, currencyId: string) => any;
@@ -0,0 +1,6 @@
1
+ declare const getSubscriptions: ({ apiHost, isInPreviewMode, token, }: {
2
+ apiHost: string;
3
+ isInPreviewMode?: boolean;
4
+ token?: string;
5
+ }) => Promise<any>;
6
+ export default getSubscriptions;
@@ -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,5 +1,5 @@
1
1
  import { BillingPeriod, Plan, Product } from "@bunnyapp/common";
2
2
  export type PeriodMonths = 0 | 1 | 3 | 6 | 12;
3
3
  export declare const periodMonthsConverter: (period: PeriodMonths) => BillingPeriod;
4
- export declare const billingPeriodConverter: (period?: BillingPeriod) => 0 | 1 | 3 | 6 | 12;
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;