@bunnyapp/components 1.6.0-beta.9 → 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 +1 -1
  2. package/dist/cjs/types/src/components/FeatureUsageGraph.d.ts +4 -3
  3. package/dist/cjs/types/src/components/Invoice/InvoiceQuoteContext.d.ts +16 -0
  4. package/dist/cjs/types/src/components/PaymentForm/hooks/useHandlePayment.d.ts +25 -0
  5. package/dist/cjs/types/src/components/QuoteProvider/QuoteProvider.d.ts +4 -0
  6. package/dist/cjs/types/src/components/QuoteProvider/context/QuoteContext.d.ts +19 -0
  7. package/dist/cjs/types/src/components/QuoteProvider/fragments/quoteFieldsFragment.d.ts +65 -0
  8. package/dist/cjs/types/src/components/QuoteProvider/fragments/quoteFragment.d.ts +13 -0
  9. package/dist/cjs/types/src/components/QuoteProvider/hooks/useFeatureQuantities.d.ts +12 -0
  10. package/dist/cjs/types/src/components/QuoteProvider/hooks/useQuoteCreate.d.ts +9 -0
  11. package/dist/cjs/types/src/components/QuoteProvider/hooks/useQuoteQuantities.d.ts +11 -0
  12. package/dist/cjs/types/src/components/QuoteProvider/mutations/quoteChangeUpdate.d.ts +12 -0
  13. package/dist/cjs/types/src/components/QuoteProvider/queries/getQuote.d.ts +6 -0
  14. package/dist/cjs/types/src/components/QuoteProvider/utils/getQuantityFromQuoteChange.d.ts +11 -0
  15. package/dist/cjs/types/src/components/QuoteProvider/utils/quoteChangeCanBeEdited.d.ts +4 -0
  16. package/dist/cjs/types/src/components/Subscriptions/SubscriptionsContext.d.ts +18 -0
  17. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/priceListCardDesktop/PriceListCardDesktop.d.ts +15 -0
  18. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceDescription/PriceListCardPriceDescription.d.ts +6 -0
  19. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceDescription/utils/hasMultipleRecurringCharges.d.ts +2 -0
  20. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/QuantityDrawer.d.ts +15 -0
  21. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/fragments/QuantityDrawerQuoteFragment.d.ts +10 -0
  22. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/hooks/useQuoteQueryData.d.ts +3 -0
  23. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/hooks/useSetQuoteQueryData.d.ts +5 -0
  24. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/queries/quoteChargeCreate.d.ts +12 -0
  25. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/queries/quoteChargeUpdate.d.ts +1 -0
  26. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/queries/quoteSubscriptionUpdate.d.ts +1 -0
  27. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/utils/formatDateForApi.d.ts +2 -0
  28. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/utils/utils.d.ts +35 -0
  29. package/dist/cjs/types/src/components/Subscriptions/subscriptionsList/subscriptionCardHeader/SubscriptionCardHeader.d.ts +7 -0
  30. package/dist/cjs/types/src/components/Subscriptions/subscriptionsList/subscriptionCardHeader/components/SubscriptionCardActions.d.ts +21 -0
  31. package/dist/cjs/types/src/components/Subscriptions/subscriptionsList/subscriptionCardHeader/queries/getPriceListChangeOptions.d.ts +5 -0
  32. package/dist/cjs/types/src/components/Subscriptions/tieredDisplayDropdown/TieredDisplayDropdown.d.ts +9 -0
  33. package/dist/cjs/types/src/components/Subscriptions/tieredDisplayDropdown/util.d.ts +9 -0
  34. package/dist/cjs/types/src/components/Transactions/TransactionsListContext.d.ts +28 -0
  35. package/dist/cjs/types/src/components/priceListPricing/PricingTooltip.d.ts +41 -0
  36. package/dist/cjs/types/src/components/priceListPricing/components/ChargePriceTiers.d.ts +23 -0
  37. package/dist/cjs/types/src/components/priceListPricing/components/PriceTierPrice.d.ts +7 -0
  38. package/dist/cjs/types/src/components/priceListPricing/components/PriceTierRow.d.ts +13 -0
  39. package/dist/cjs/types/src/components/priceListPricing/misc/consts.d.ts +1 -0
  40. package/dist/cjs/types/src/components/priceListPricing/types/PriceTier.d.ts +4 -0
  41. package/dist/cjs/types/src/components/priceListPricing/utils/getPricingModelDescription.d.ts +2 -0
  42. package/dist/cjs/types/src/components/priceListPricing/utils/getPricingModelTitle.d.ts +2 -0
  43. package/dist/cjs/types/src/components/priceListPricing/utils/hasPriceTiers.d.ts +9 -0
  44. package/dist/cjs/types/src/components/priceListPricing/utils/priceListChargeUtil.ts/getChargeBasePrice.d.ts +8 -0
  45. package/dist/cjs/types/src/components/priceListPricing/utils/priceListChargeUtil.ts/getFirstTierPrice.d.ts +7 -0
  46. package/dist/cjs/types/src/graphql/queries/getSubscriptions.d.ts +6 -0
  47. package/dist/cjs/types/src/graphql-codegen/exportedScalarTypes.d.ts +6 -0
  48. package/dist/esm/index.js +1 -1
  49. package/dist/esm/types/src/components/FeatureUsageGraph.d.ts +4 -3
  50. package/dist/esm/types/src/components/Invoice/InvoiceQuoteContext.d.ts +16 -0
  51. package/dist/esm/types/src/components/PaymentForm/hooks/useHandlePayment.d.ts +25 -0
  52. package/dist/esm/types/src/components/QuoteProvider/QuoteProvider.d.ts +4 -0
  53. package/dist/esm/types/src/components/QuoteProvider/context/QuoteContext.d.ts +19 -0
  54. package/dist/esm/types/src/components/QuoteProvider/fragments/quoteFieldsFragment.d.ts +65 -0
  55. package/dist/esm/types/src/components/QuoteProvider/fragments/quoteFragment.d.ts +13 -0
  56. package/dist/esm/types/src/components/QuoteProvider/hooks/useFeatureQuantities.d.ts +12 -0
  57. package/dist/esm/types/src/components/QuoteProvider/hooks/useQuoteCreate.d.ts +9 -0
  58. package/dist/esm/types/src/components/QuoteProvider/hooks/useQuoteQuantities.d.ts +11 -0
  59. package/dist/esm/types/src/components/QuoteProvider/mutations/quoteChangeUpdate.d.ts +12 -0
  60. package/dist/esm/types/src/components/QuoteProvider/queries/getQuote.d.ts +6 -0
  61. package/dist/esm/types/src/components/QuoteProvider/utils/getQuantityFromQuoteChange.d.ts +11 -0
  62. package/dist/esm/types/src/components/QuoteProvider/utils/quoteChangeCanBeEdited.d.ts +4 -0
  63. package/dist/esm/types/src/components/Subscriptions/SubscriptionsContext.d.ts +18 -0
  64. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/priceListCardDesktop/PriceListCardDesktop.d.ts +15 -0
  65. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceDescription/PriceListCardPriceDescription.d.ts +6 -0
  66. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceDescription/utils/hasMultipleRecurringCharges.d.ts +2 -0
  67. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/QuantityDrawer.d.ts +15 -0
  68. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/fragments/QuantityDrawerQuoteFragment.d.ts +10 -0
  69. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/hooks/useQuoteQueryData.d.ts +3 -0
  70. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/hooks/useSetQuoteQueryData.d.ts +5 -0
  71. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/queries/quoteChargeCreate.d.ts +12 -0
  72. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/queries/quoteChargeUpdate.d.ts +1 -0
  73. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/queries/quoteSubscriptionUpdate.d.ts +1 -0
  74. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/utils/formatDateForApi.d.ts +2 -0
  75. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/utils/utils.d.ts +35 -0
  76. package/dist/esm/types/src/components/Subscriptions/subscriptionsList/subscriptionCardHeader/SubscriptionCardHeader.d.ts +7 -0
  77. package/dist/esm/types/src/components/Subscriptions/subscriptionsList/subscriptionCardHeader/components/SubscriptionCardActions.d.ts +21 -0
  78. package/dist/esm/types/src/components/Subscriptions/subscriptionsList/subscriptionCardHeader/queries/getPriceListChangeOptions.d.ts +5 -0
  79. package/dist/esm/types/src/components/Subscriptions/tieredDisplayDropdown/TieredDisplayDropdown.d.ts +9 -0
  80. package/dist/esm/types/src/components/Subscriptions/tieredDisplayDropdown/util.d.ts +9 -0
  81. package/dist/esm/types/src/components/Transactions/TransactionsListContext.d.ts +28 -0
  82. package/dist/esm/types/src/components/priceListPricing/PricingTooltip.d.ts +41 -0
  83. package/dist/esm/types/src/components/priceListPricing/components/ChargePriceTiers.d.ts +23 -0
  84. package/dist/esm/types/src/components/priceListPricing/components/PriceTierPrice.d.ts +7 -0
  85. package/dist/esm/types/src/components/priceListPricing/components/PriceTierRow.d.ts +13 -0
  86. package/dist/esm/types/src/components/priceListPricing/misc/consts.d.ts +1 -0
  87. package/dist/esm/types/src/components/priceListPricing/types/PriceTier.d.ts +4 -0
  88. package/dist/esm/types/src/components/priceListPricing/utils/getPricingModelDescription.d.ts +2 -0
  89. package/dist/esm/types/src/components/priceListPricing/utils/getPricingModelTitle.d.ts +2 -0
  90. package/dist/esm/types/src/components/priceListPricing/utils/hasPriceTiers.d.ts +9 -0
  91. package/dist/esm/types/src/components/priceListPricing/utils/priceListChargeUtil.ts/getChargeBasePrice.d.ts +8 -0
  92. package/dist/esm/types/src/components/priceListPricing/utils/priceListChargeUtil.ts/getFirstTierPrice.d.ts +7 -0
  93. package/dist/esm/types/src/graphql/queries/getSubscriptions.d.ts +6 -0
  94. package/dist/esm/types/src/graphql-codegen/exportedScalarTypes.d.ts +6 -0
  95. package/package.json +1 -1
package/dist/cjs/index.js CHANGED
@@ -52,7 +52,7 @@ var css_248z = ":root {\n --row-background: #ffffff;\n --row-background-altern
52
52
  styleInject(css_248z);
53
53
 
54
54
  // This will be replaced at build time by rollup-plugin-replace
55
- const PACKAGE_VERSION = '1.6.0-beta.6';
55
+ const PACKAGE_VERSION = '1.6.0-beta.9';
56
56
  const createRequestHeaders = (token) => {
57
57
  const headers = createClientDevHeaders({ token });
58
58
  // Add the components version header
@@ -1,6 +1,7 @@
1
- import { FeatureUsage, SubscriptionCharge } from "@bunnyapp/common";
2
- declare const FeatureUsageGraph: ({ charge, featureUsage, }: {
1
+ import { FeatureUsage, SubscriptionCharge } from '@bunnyapp/common';
2
+ declare const FeatureUsageGraph: ({ charge, featureUsage, useAreaChart, }: {
3
3
  charge: SubscriptionCharge;
4
4
  featureUsage: FeatureUsage;
5
- }) => import("react/jsx-runtime").JSX.Element;
5
+ useAreaChart?: boolean;
6
+ }) => import("react/jsx-runtime").JSX.Element | "no usage" | null;
6
7
  export default FeatureUsageGraph;
@@ -0,0 +1,16 @@
1
+ import { ShadowType } from "../../types/shadowType";
2
+ import { FormattedInvoice, FormattedQuote } from "@bunnyapp/common";
3
+ export type InvoiceQuoteContextProps = {
4
+ id?: string;
5
+ invoiceQuoteViewComponent?: React.ReactNode;
6
+ backButtonName?: string;
7
+ onBackButtonClick?: () => void;
8
+ onInvoiceDownloadError?: () => void;
9
+ onPaymentSuccess?: (savePaymentMethod?: boolean) => void;
10
+ shadow?: ShadowType;
11
+ className?: string;
12
+ hideDownloadButton?: boolean;
13
+ onInvoiceLoaded?: (formattedInvoice: FormattedInvoice) => void;
14
+ onQuoteLoaded?: (formattedQuote: FormattedQuote) => void;
15
+ };
16
+ export declare const InvoiceQuoteContext: import("react").Context<InvoiceQuoteContextProps>;
@@ -0,0 +1,25 @@
1
+ import { FormattedInvoice, Invoice, PluginData, Quote } from '@bunnyapp/common';
2
+ export declare enum PaymentType {
3
+ PAY = "PAY",
4
+ APPROVE_HOLD = "APPROVE_HOLD"
5
+ }
6
+ declare const useHandlePayment: ({ quote, invoice, onPaymentSuccess, onPaymentHoldSuccess, plugin, paymentHoldOptions, }: {
7
+ quote?: Quote;
8
+ invoice?: FormattedInvoice | Invoice;
9
+ onPaymentSuccess?: (response: any) => void;
10
+ onPaymentHoldSuccess?: (response: any) => void;
11
+ plugin: PluginData | undefined;
12
+ paymentHoldOptions: {
13
+ payToAccept?: boolean;
14
+ amountToHold?: number;
15
+ };
16
+ }) => {
17
+ handlePayment: ({ overridePaymentMethodId, }: {
18
+ overridePaymentMethodId?: string;
19
+ }) => Promise<void>;
20
+ payableAvailable: boolean;
21
+ isPaying: boolean;
22
+ paymentType: PaymentType;
23
+ formattedAmountDue: string | number;
24
+ };
25
+ export default useHandlePayment;
@@ -0,0 +1,4 @@
1
+ declare function QuoteProvider({ children }: {
2
+ children: React.ReactNode;
3
+ }): import("react/jsx-runtime").JSX.Element;
4
+ export default QuoteProvider;
@@ -0,0 +1,19 @@
1
+ import { PriceList } from '@bunnyapp/common';
2
+ import { ResultOf } from 'gql.tada';
3
+ import { QuoteContext_QuoteFragment } from '../fragments/quoteFragment';
4
+ export type QuoteContextValues = {
5
+ quote: ResultOf<typeof QuoteContext_QuoteFragment> | null | undefined;
6
+ selectedPriceList: PriceList | undefined;
7
+ isQuotePending: boolean;
8
+ isAddonPlanLoading: boolean;
9
+ isFeatureAddonsLoading: boolean;
10
+ isUpdatingQuote: boolean;
11
+ setIsAddonPlanLoading: React.Dispatch<React.SetStateAction<boolean>>;
12
+ addFeatureAddonLoading: (featureAddonId: string) => void;
13
+ removeFeatureAddonLoading: (featureAddonId: string) => void;
14
+ getFeatureQuantity: (featureId: string, chargeId: string) => number | undefined;
15
+ onClearQuote: () => void;
16
+ onChangeSelectedPriceList: (priceList: PriceList) => void;
17
+ onChangeQuantity: (priceListChargeId: string, quantity: number) => void;
18
+ };
19
+ export declare const QuoteContext: import("react").Context<QuoteContextValues>;
@@ -0,0 +1,65 @@
1
+ export declare const QuoteFields_QuoteFragment: import("gql.tada").TadaDocumentNode<{
2
+ accountId: string;
3
+ amount: number;
4
+ amountDue: number | null;
5
+ smallUnitAmountDue: number | null;
6
+ currencyId: string;
7
+ id: string | null;
8
+ payableId: string | null;
9
+ periodAmount: number | null;
10
+ subtotal: number;
11
+ taxAmount: number;
12
+ startDate: unknown;
13
+ formattedQuote: {
14
+ html: string | null;
15
+ } | null;
16
+ amountsByPeriod: {
17
+ amount: number | null;
18
+ startDate: unknown;
19
+ }[];
20
+ kind: "ACTIVATE" | "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "COUPON" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT";
21
+ quoteChanges: {
22
+ currencyId: string;
23
+ id: string | null;
24
+ kind: "ACTIVATE" | "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "COUPON" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT";
25
+ charges: {
26
+ subtotal: number | null;
27
+ amountsByPeriod: {
28
+ amount: number | null;
29
+ startDate: unknown;
30
+ }[] | null;
31
+ amount: number | null;
32
+ billingPeriod: "ONCE" | "MONTHLY" | "QUARTERLY" | "SEMI_ANNUAL" | "ANNUAL" | null;
33
+ currencyId: string;
34
+ feature: {
35
+ unitName: string | null;
36
+ } | null;
37
+ id: string | null;
38
+ name: string | null;
39
+ priceListCharge: {
40
+ id: string;
41
+ } | null;
42
+ priceList: {
43
+ id: string;
44
+ } | null;
45
+ coupon: {
46
+ couponCode: string;
47
+ } | null;
48
+ quantity: number | null;
49
+ kind: "ACTIVATE" | "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "COUPON" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | null;
50
+ }[];
51
+ priceList: {
52
+ id: string;
53
+ plan: {
54
+ name: string;
55
+ } | null;
56
+ product: {
57
+ name: string;
58
+ } | null;
59
+ } | null;
60
+ }[] | null;
61
+ }, {}, {
62
+ fragment: "QuoteFields_QuoteFragment";
63
+ on: "Quote";
64
+ masked: false;
65
+ }>;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Central quote fragment for QuoteProvider context.
3
+ *
4
+ * This fragment aggregates all child component fragments to ensure the QuoteProvider
5
+ * fetches all required quote data upfront. When a component needs specific quote fields,
6
+ * add its fragment here to maintain type safety and avoid over-fetching.
7
+ *
8
+ * Pattern: Fragment Composition
9
+ * - Components define their data needs via fragments
10
+ * - Provider composes these fragments into a single query
11
+ * - Type safety ensures all required fields are fetched
12
+ */
13
+ export declare const QuoteContext_QuoteFragment: any;
@@ -0,0 +1,12 @@
1
+ export type FeatureQuantitiesDict = Record<string, number | undefined>;
2
+ /**
3
+ * Hook to manage feature quantities using a dictionary keyed by feature ID
4
+ * This tracks quantities for each unique feature.
5
+ */
6
+ export declare function useFeatureQuantities({ onFeatureQuantitiesChanged, }: {
7
+ onFeatureQuantitiesChanged?: (featureQuantities: FeatureQuantitiesDict) => void;
8
+ }): {
9
+ featureQuantities: FeatureQuantitiesDict;
10
+ getFeatureQuantity: (featureId: string, featureQuantities: FeatureQuantitiesDict) => number | undefined;
11
+ onUpdateFeatureQuantity: (featureId: string, quantity: number) => void;
12
+ };
@@ -0,0 +1,9 @@
1
+ import { PriceList, Subscription } from '@bunnyapp/common';
2
+ export declare const useQuoteCreate: ({ upgradingSubscription, selectedPriceList, token, }: {
3
+ upgradingSubscription?: Subscription;
4
+ selectedPriceList?: PriceList;
5
+ token?: string;
6
+ }) => {
7
+ quote: any;
8
+ isQuotePending: boolean;
9
+ };
@@ -0,0 +1,11 @@
1
+ import { PriceList } from '@bunnyapp/common';
2
+ import { ResultOf } from 'gql.tada';
3
+ import { QuoteContext_QuoteFragment } from '../fragments/quoteFragment';
4
+ export declare const useQuoteQuantities: ({ selectedPriceList, quote, }: {
5
+ selectedPriceList: PriceList;
6
+ quote: ResultOf<typeof QuoteContext_QuoteFragment> | null | undefined;
7
+ }) => {
8
+ onChangeQuantity: (priceListChargeId: string, quantity: number) => void;
9
+ getFeatureQuantity: (featureId: string) => number | undefined;
10
+ isUpdatingCharges: boolean;
11
+ };
@@ -0,0 +1,12 @@
1
+ declare const quoteChangeUpdate: ({ quoteChangeId, charges, apiHost, token, }: {
2
+ quoteChangeId: string;
3
+ charges: {
4
+ id: string;
5
+ quantity: number;
6
+ }[];
7
+ apiHost: string;
8
+ token: string;
9
+ }) => Promise<{
10
+ quote: any;
11
+ } | null | undefined>;
12
+ export default quoteChangeUpdate;
@@ -0,0 +1,6 @@
1
+ export declare const getQuote: ({ id, token, apiHost, includeHtmlField, }: {
2
+ id: string;
3
+ token?: string;
4
+ apiHost: string;
5
+ includeHtmlField?: boolean;
6
+ }) => Promise<any>;
@@ -0,0 +1,11 @@
1
+ export declare function getQuantityFromQuoteChange(quoteChange: {
2
+ priceList: {
3
+ id: string;
4
+ } | null;
5
+ charges: {
6
+ feature: {
7
+ id: string;
8
+ } | null;
9
+ quantity: number | null;
10
+ }[];
11
+ } | null, featureId: string): number | null | undefined;
@@ -0,0 +1,4 @@
1
+ import { QuoteChangeKind } from '@/graphql-codegen/exportedScalarTypes';
2
+ export declare function isQuoteChangeEditable(quoteChange: {
3
+ kind: QuoteChangeKind;
4
+ }): boolean;
@@ -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;