@bunnyapp/components 1.6.0-beta.15 → 1.6.0-beta.17

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 (137) hide show
  1. package/dist/cjs/index.js +3756 -3246
  2. package/dist/cjs/types/src/components/BunnyProvider.d.ts +0 -2
  3. package/dist/cjs/types/src/components/Subscriptions/Subscriptions.d.ts +0 -4
  4. package/dist/cjs/types/src/components/Subscriptions/SubscriptionsListContainer.d.ts +0 -4
  5. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/PriceListGrid.d.ts +1 -1
  6. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/checkoutBar/CheckoutPrice.d.ts +1 -1
  7. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/BillingPeriodSelector.d.ts +3 -3
  8. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/PriceListGridDesktop.d.ts +2 -2
  9. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/featureAddons/FeatureAddonRow.d.ts +33 -0
  10. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/featureAddons/FeatureAddons.d.ts +12 -3
  11. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/featureAddons/FeatureAddonsList.d.ts +26 -4
  12. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/priceListCardDesktop/PriceListCardDesktop.d.ts +41 -4
  13. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/priceListCardDesktop/addonPlans/AddonPlans.d.ts +10 -0
  14. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/priceListCardDesktop/addonPlans/components/AddonPlanModal.d.ts +19 -0
  15. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/priceListCardDesktop/addonPlans/components/AddonPlanRow.d.ts +24 -0
  16. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/priceListCardDesktop/addonPlans/fragments/AddonPlans_PlanFragment.d.ts +18 -0
  17. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/priceListCardDesktop/addonPlans/queries/getAddonPlans.d.ts +13 -0
  18. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerMobile/PriceListCardMobile.d.ts +19 -2
  19. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceDescription/PriceListCardPriceDescription.d.ts +20 -3
  20. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceDescription/utils/hasMultipleRecurringCharges.d.ts +12 -2
  21. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceListCard.d.ts +21 -4
  22. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceListCardButton.d.ts +16 -3
  23. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceListCardFeature.d.ts +1 -1
  24. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceListCardPrice.d.ts +12 -3
  25. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceListCardTitle.d.ts +2 -3
  26. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/priceListCardUtils.d.ts +1 -1
  27. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PreviewModeAdvisary.d.ts +1 -1
  28. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/QuantityChangeGridRow.d.ts +1 -5
  29. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/QuantityDrawer.d.ts +1 -4
  30. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/QuoteChangeSummarySection.d.ts +11 -6
  31. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/context/quoteIdContext.d.ts +5 -0
  32. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/fragments/{QuantityDrawerQuoteFragment.d.ts → QuantityDrawer_QuoteFragment.d.ts} +4 -0
  33. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/hooks/useQuoteQueryData.d.ts +3 -3
  34. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/hooks/useSetQuoteQueryData.d.ts +2 -2
  35. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/quantityChangeDrawerDesktop/QuantityChangeDrawerDesktop.d.ts +1 -6
  36. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/{QuantityInput.d.ts → quantityInput/QuantityInput.d.ts} +1 -8
  37. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/quantityInput/fragments/QuantityInput_QuoteFragment.d.ts +27 -0
  38. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/utils/utils.d.ts +2 -1
  39. package/dist/cjs/types/src/components/Transactions/Transactions.d.ts +1 -1
  40. package/dist/cjs/types/src/components/priceListPricing/PricingTooltip.d.ts +18 -16
  41. package/dist/cjs/types/src/components/priceListPricing/utils/hasPriceTiers.d.ts +12 -8
  42. package/dist/cjs/types/src/components/priceListPricing/utils/priceListChargeUtil.ts/chargeHasPriceTiers.d.ts +12 -0
  43. package/dist/cjs/types/src/contexts/BrandContext.d.ts +11 -2
  44. package/dist/cjs/types/src/graphql/queries/getBranding.d.ts +7 -2
  45. package/dist/cjs/types/src/graphql/queries/getPriceListChangeOptions.d.ts +2 -1
  46. package/dist/cjs/types/src/hooks/useAllErrorFormats.d.ts +1 -0
  47. package/dist/cjs/types/src/hooks/useCreateQueryClient.d.ts +2 -0
  48. package/dist/cjs/types/src/hooks/useToggleAddonQuoteChange.d.ts +1 -1
  49. package/dist/cjs/types/src/utils/QueryKeyFactory.d.ts +4 -0
  50. package/dist/cjs/types/src/utils/addonPlanUtils/addonPlanUtils.d.ts +5 -0
  51. package/dist/cjs/types/src/utils/addonPlanUtils/getAddonsForBillingPeriod.d.ts +8 -0
  52. package/dist/cjs/types/src/utils/addonPlanUtils/hasUnpurchasedAddonPricelists.d.ts +15 -0
  53. package/dist/cjs/types/src/utils/createStateContext.d.ts +11 -0
  54. package/dist/cjs/types/src/utils/createValueContext.d.ts +14 -0
  55. package/dist/{esm/types/src/utils → cjs/types/src/utils/featureAddonUtils}/featureAddonUtils.d.ts +2 -3
  56. package/dist/cjs/types/src/utils/featureAddonUtils/isAddonPurchased.d.ts +24 -0
  57. package/dist/cjs/types/src/utils/priceListUtils/doesPriceListHaveFlatFeeCharges.d.ts +11 -6
  58. package/dist/cjs/types/src/utils/priceListUtils/getPrice.d.ts +11 -5
  59. package/dist/cjs/types/src/utils/priceListUtils/priceDescription.d.ts +3 -3
  60. package/dist/cjs/types/src/utils/priceListUtils/priceListPriceText.d.ts +17 -10
  61. package/dist/cjs/types/src/utils/pricePickerUtils.d.ts +2 -2
  62. package/dist/esm/index.js +4198 -3688
  63. package/dist/esm/types/src/components/BunnyProvider.d.ts +0 -2
  64. package/dist/esm/types/src/components/Subscriptions/Subscriptions.d.ts +0 -4
  65. package/dist/esm/types/src/components/Subscriptions/SubscriptionsListContainer.d.ts +0 -4
  66. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/PriceListGrid.d.ts +1 -1
  67. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/checkoutBar/CheckoutPrice.d.ts +1 -1
  68. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/BillingPeriodSelector.d.ts +3 -3
  69. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/PriceListGridDesktop.d.ts +2 -2
  70. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/featureAddons/FeatureAddonRow.d.ts +33 -0
  71. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/featureAddons/FeatureAddons.d.ts +12 -3
  72. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/featureAddons/FeatureAddonsList.d.ts +26 -4
  73. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/priceListCardDesktop/PriceListCardDesktop.d.ts +41 -4
  74. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/priceListCardDesktop/addonPlans/AddonPlans.d.ts +10 -0
  75. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/priceListCardDesktop/addonPlans/components/AddonPlanModal.d.ts +19 -0
  76. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/priceListCardDesktop/addonPlans/components/AddonPlanRow.d.ts +24 -0
  77. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/priceListCardDesktop/addonPlans/fragments/AddonPlans_PlanFragment.d.ts +18 -0
  78. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/priceListCardDesktop/addonPlans/queries/getAddonPlans.d.ts +13 -0
  79. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerMobile/PriceListCardMobile.d.ts +19 -2
  80. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceDescription/PriceListCardPriceDescription.d.ts +20 -3
  81. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceDescription/utils/hasMultipleRecurringCharges.d.ts +12 -2
  82. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceListCard.d.ts +21 -4
  83. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceListCardButton.d.ts +16 -3
  84. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceListCardFeature.d.ts +1 -1
  85. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceListCardPrice.d.ts +12 -3
  86. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/PriceListCardTitle.d.ts +2 -3
  87. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListCard/priceListCardUtils.d.ts +1 -1
  88. package/dist/esm/types/src/components/Subscriptions/Upgrade/PreviewModeAdvisary.d.ts +1 -1
  89. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/QuantityChangeGridRow.d.ts +1 -5
  90. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/QuantityDrawer.d.ts +1 -4
  91. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/QuoteChangeSummarySection.d.ts +11 -6
  92. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/context/quoteIdContext.d.ts +5 -0
  93. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/fragments/{QuantityDrawerQuoteFragment.d.ts → QuantityDrawer_QuoteFragment.d.ts} +4 -0
  94. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/hooks/useQuoteQueryData.d.ts +3 -3
  95. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/hooks/useSetQuoteQueryData.d.ts +2 -2
  96. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/quantityChangeDrawerDesktop/QuantityChangeDrawerDesktop.d.ts +1 -6
  97. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/{QuantityInput.d.ts → quantityInput/QuantityInput.d.ts} +1 -8
  98. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/quantityInput/fragments/QuantityInput_QuoteFragment.d.ts +27 -0
  99. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/utils/utils.d.ts +2 -1
  100. package/dist/esm/types/src/components/Transactions/Transactions.d.ts +1 -1
  101. package/dist/esm/types/src/components/priceListPricing/PricingTooltip.d.ts +18 -16
  102. package/dist/esm/types/src/components/priceListPricing/utils/hasPriceTiers.d.ts +12 -8
  103. package/dist/esm/types/src/components/priceListPricing/utils/priceListChargeUtil.ts/chargeHasPriceTiers.d.ts +12 -0
  104. package/dist/esm/types/src/contexts/BrandContext.d.ts +11 -2
  105. package/dist/esm/types/src/graphql/queries/getBranding.d.ts +7 -2
  106. package/dist/esm/types/src/graphql/queries/getPriceListChangeOptions.d.ts +2 -1
  107. package/dist/esm/types/src/hooks/useAllErrorFormats.d.ts +1 -0
  108. package/dist/esm/types/src/hooks/useCreateQueryClient.d.ts +2 -0
  109. package/dist/esm/types/src/hooks/useToggleAddonQuoteChange.d.ts +1 -1
  110. package/dist/esm/types/src/utils/QueryKeyFactory.d.ts +4 -0
  111. package/dist/esm/types/src/utils/addonPlanUtils/addonPlanUtils.d.ts +5 -0
  112. package/dist/esm/types/src/utils/addonPlanUtils/getAddonsForBillingPeriod.d.ts +8 -0
  113. package/dist/esm/types/src/utils/addonPlanUtils/hasUnpurchasedAddonPricelists.d.ts +15 -0
  114. package/dist/esm/types/src/utils/createStateContext.d.ts +11 -0
  115. package/dist/esm/types/src/utils/createValueContext.d.ts +14 -0
  116. package/dist/{cjs/types/src/utils → esm/types/src/utils/featureAddonUtils}/featureAddonUtils.d.ts +2 -3
  117. package/dist/esm/types/src/utils/featureAddonUtils/isAddonPurchased.d.ts +24 -0
  118. package/dist/esm/types/src/utils/priceListUtils/doesPriceListHaveFlatFeeCharges.d.ts +11 -6
  119. package/dist/esm/types/src/utils/priceListUtils/getPrice.d.ts +11 -5
  120. package/dist/esm/types/src/utils/priceListUtils/priceDescription.d.ts +3 -3
  121. package/dist/esm/types/src/utils/priceListUtils/priceListPriceText.d.ts +17 -10
  122. package/dist/esm/types/src/utils/pricePickerUtils.d.ts +2 -2
  123. package/package.json +1 -1
  124. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/PlanAddonsCard.d.ts +0 -11
  125. package/dist/cjs/types/src/graphql/queries/getAddonPlans.d.ts +0 -37
  126. package/dist/cjs/types/src/utils/GraphQLClient.d.ts +0 -2
  127. package/dist/cjs/types/src/utils/addonPlanUtils.d.ts +0 -8
  128. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/PlanAddonsCard.d.ts +0 -11
  129. package/dist/esm/types/src/graphql/queries/getAddonPlans.d.ts +0 -37
  130. package/dist/esm/types/src/utils/GraphQLClient.d.ts +0 -2
  131. package/dist/esm/types/src/utils/addonPlanUtils.d.ts +0 -8
  132. /package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/{queries → mutations}/quoteChargeCreate.d.ts +0 -0
  133. /package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/{queries → mutations}/quoteChargeUpdate.d.ts +0 -0
  134. /package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/{queries → mutations}/quoteSubscriptionUpdate.d.ts +0 -0
  135. /package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/{queries → mutations}/quoteChargeCreate.d.ts +0 -0
  136. /package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/{queries → mutations}/quoteChargeUpdate.d.ts +0 -0
  137. /package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/{queries → mutations}/quoteSubscriptionUpdate.d.ts +0 -0
@@ -1,4 +1,3 @@
1
- import { Quote } from '@bunnyapp/common';
2
1
  import { FragmentOf } from 'gql.tada';
3
2
  export declare const QuantityInput_SubscriptionChargeFragment: import("gql.tada").TadaDocumentNode<{
4
3
  id: string | null;
@@ -31,14 +30,8 @@ export declare const QuantityInput_SubscriptionFragment: import("gql.tada").Tada
31
30
  on: "Subscription";
32
31
  masked: true;
33
32
  }>;
34
- declare const QuantityInput: ({ charge: maskedCharge, editingQuote, editingQuoteId, setEditingQuoteData, subscription: maskedSubscription, setUpdatingChargeQuantityId, updatingChargeQuantityId, setErrorUpdatingQuantity, }: {
33
+ declare const QuantityInput: ({ charge: maskedCharge, subscription: maskedSubscription, setUpdatingChargeQuantityId, updatingChargeQuantityId, setErrorUpdatingQuantity, }: {
35
34
  charge: FragmentOf<typeof QuantityInput_SubscriptionChargeFragment>;
36
- editingQuote?: Quote;
37
- editingQuoteId?: string;
38
- setEditingQuoteData: (editingQuoteData: {
39
- id: string;
40
- isTrial: boolean;
41
- } | undefined) => void;
42
35
  subscription: FragmentOf<typeof QuantityInput_SubscriptionFragment>;
43
36
  setUpdatingChargeQuantityId: (updatingChargeQuantityId: string | undefined) => void;
44
37
  updatingChargeQuantityId: string | undefined;
@@ -0,0 +1,27 @@
1
+ export declare const QuantityInput_QuoteFragment: import("gql.tada").TadaDocumentNode<{
2
+ id: string | null;
3
+ quoteChanges: {
4
+ id: string | null;
5
+ priceList: {
6
+ id: string;
7
+ } | null;
8
+ charges: {
9
+ id: string | null;
10
+ priceListCharge: {
11
+ id: string;
12
+ } | null;
13
+ }[];
14
+ subscription: {
15
+ charges: {
16
+ id: string | null;
17
+ priceListCharge: {
18
+ id: string;
19
+ } | null;
20
+ }[] | null;
21
+ } | null;
22
+ }[] | null;
23
+ }, {}, {
24
+ fragment: "QuantityInput_QuoteFragment";
25
+ on: "Quote";
26
+ masked: true;
27
+ }>;
@@ -4,6 +4,7 @@ export declare const CanShowQuantitiesInput_SubscriptionChargeFragment: import("
4
4
  pricingModel: "FLAT" | "TIERED" | "VOLUME" | "BANDS" | null;
5
5
  expired: boolean;
6
6
  selfServiceQuantity: boolean | null;
7
+ kind: "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "COUPON" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | "ACTIVATE" | null;
7
8
  }, {}, {
8
9
  fragment: "CanShowQuantitiesInput_SubscriptionChargeFragment";
9
10
  on: "SubscriptionCharge";
@@ -15,7 +16,7 @@ export declare const CanShowQuantitiesInput_SubscriptionFragment: import("gql.ta
15
16
  priceList: {
16
17
  id: string;
17
18
  } | null;
18
- chargeReport: {
19
+ currentCharges: {
19
20
  [$tada.fragmentRefs]: {
20
21
  CanShowQuantitiesInput_SubscriptionChargeFragment: "SubscriptionCharge";
21
22
  };
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import { Transaction, TransactionKind } from '@bunnyapp/common';
3
+ import { TransactionDateType } from '../../contexts/TransactionsListContext';
3
4
  import { ShadowType } from '../../types/shadowType';
4
5
  import { TransactionListColumnType } from './transactionsList/TransactionsListDesktop';
5
- import { TransactionDateType } from '../../contexts/TransactionsListContext';
6
6
  export default function Transactions({ transactionComponent, showSearchBar, showTitle, title, columns, className, shadow, searchBarClassName, useModal, onTransactionClick, suppressTransactionDisplay, kindsToShow, style, filter, noTransactionsMessage, filterTransactions, sortTransactions, transactionDateType, hidePaymentForm, }: {
7
7
  /** A custom component to render instead of the default invoice component */
8
8
  transactionComponent?: React.ReactNode;
@@ -1,4 +1,3 @@
1
- import { PlanPricingStyles, PricingModel } from '@/graphql-codegen/exportedScalarTypes';
2
1
  import { FragmentOf } from 'gql.tada';
3
2
  export declare const PricingTooltip_PriceListChargeFragment: import("gql.tada").TadaDocumentNode<{
4
3
  priceListChargeTiers: {
@@ -13,6 +12,8 @@ export declare const PricingTooltip_PriceListChargeFragment: import("gql.tada").
13
12
  basePrice: number;
14
13
  name: string;
15
14
  [$tada.fragmentRefs]: {
15
+ ChargeHasPriceTiers_PriceListChargeFragment: "PriceListCharge";
16
+ } & {
16
17
  ChargePriceTiers_PriceListChargeFragment: "PriceListCharge";
17
18
  };
18
19
  }, {}, {
@@ -20,22 +21,23 @@ export declare const PricingTooltip_PriceListChargeFragment: import("gql.tada").
20
21
  on: "PriceListCharge";
21
22
  masked: true;
22
23
  }>;
23
- export declare const PricingTooltip: ({ className, priceListCharges: maskedPriceListCharges, currencyId, priceList, }: {
24
+ export declare const PricingTooltip_PriceListFragment: import("gql.tada").TadaDocumentNode<{
25
+ showPriceAsMonthly: boolean | null;
26
+ periodMonths: number | null;
27
+ currencyId: string;
28
+ monthlyBasePrice: number | null;
29
+ basePrice: number | null;
30
+ [$tada.fragmentRefs]: {
31
+ DoesPriceListHaveFlatFeeCharges_PriceListFragment: "PriceList";
32
+ };
33
+ }, {}, {
34
+ fragment: "PricingTooltip_PriceListFragment";
35
+ on: "PriceList";
36
+ masked: true;
37
+ }>;
38
+ export declare const PricingTooltip: ({ className, priceListCharges: maskedPriceListCharges, currencyId, priceList: maskedPriceList, }: {
24
39
  className?: string;
25
40
  priceListCharges: FragmentOf<typeof PricingTooltip_PriceListChargeFragment>[];
26
41
  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
- };
42
+ priceList: FragmentOf<typeof PricingTooltip_PriceListFragment>;
41
43
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,13 @@
1
- import { PriceTier } from '../types/PriceTier';
2
- export declare const priceListHasPriceTiers: (priceList: {
1
+ import { FragmentOf } from 'gql.tada';
2
+ export declare const PriceListHasPriceTiers_PriceListFragment: import("gql.tada").TadaDocumentNode<{
3
3
  charges: {
4
- priceListChargeTiers: PriceTier[];
5
- }[];
6
- }) => boolean;
7
- export declare const chargeHasPriceTiers: (charge: {
8
- priceListChargeTiers: PriceTier[] | null;
9
- }) => boolean | 0 | undefined;
4
+ [$tada.fragmentRefs]: {
5
+ ChargeHasPriceTiers_PriceListChargeFragment: "PriceListCharge";
6
+ };
7
+ }[] | null;
8
+ }, {}, {
9
+ fragment: "PriceListHasPriceTiers_PriceListFragment";
10
+ on: "PriceList";
11
+ masked: true;
12
+ }>;
13
+ export declare const priceListHasPriceTiers: (maskedPriceList: FragmentOf<typeof PriceListHasPriceTiers_PriceListFragment>) => boolean | undefined;
@@ -0,0 +1,12 @@
1
+ import { FragmentOf } from 'gql.tada';
2
+ export declare const ChargeHasPriceTiers_PriceListChargeFragment: import("gql.tada").TadaDocumentNode<{
3
+ priceListChargeTiers: {
4
+ starts: number | null;
5
+ price: number | null;
6
+ }[] | null;
7
+ }, {}, {
8
+ fragment: "ChargeHasPriceTiers_PriceListChargeFragment";
9
+ on: "PriceListCharge";
10
+ masked: true;
11
+ }>;
12
+ export declare function chargeHasPriceTiers(maskedCharge: FragmentOf<typeof ChargeHasPriceTiers_PriceListChargeFragment>): boolean | 0 | undefined;
@@ -1,6 +1,15 @@
1
- export declare const BrandContext: import("react").Context<{
1
+ declare const BrandProvider: ({ value, children }: {
2
+ value: {
3
+ accentColor: string;
4
+ brandColor: string;
5
+ secondaryColor: string;
6
+ topNavImageUrl: string;
7
+ };
8
+ children?: import("react").ReactNode;
9
+ }) => import("react/jsx-runtime").JSX.Element, useBrand: () => {
2
10
  accentColor: string;
3
11
  brandColor: string;
4
12
  secondaryColor: string;
5
13
  topNavImageUrl: string;
6
- }>;
14
+ };
15
+ export { BrandProvider, useBrand };
@@ -1,6 +1,11 @@
1
- import { EntityBranding } from '@bunnyapp/common';
2
1
  declare const getBranding: ({ token, apiHost }: {
3
2
  token?: string;
4
3
  apiHost: string;
5
- }) => Promise<EntityBranding>;
4
+ }) => Promise<{
5
+ entityBranding: {
6
+ accentColor: string | null;
7
+ brandColor: string | null;
8
+ topNavImageUrl: string;
9
+ };
10
+ }>;
6
11
  export default getBranding;
@@ -1,8 +1,9 @@
1
1
  import { PriceListChangeOptions } from '@bunnyapp/common';
2
- declare const getPriceListChangeOptions: ({ apiHost, isInPreviewMode, token, subscriptionId, }: {
2
+ declare const getPriceListChangeOptions: ({ apiHost, isInPreviewMode, token, subscriptionId, productId, }: {
3
3
  apiHost: string;
4
4
  isInPreviewMode?: boolean;
5
5
  token?: string;
6
6
  subscriptionId?: string;
7
+ productId?: string;
7
8
  }) => Promise<PriceListChangeOptions>;
8
9
  export default getPriceListChangeOptions;
@@ -0,0 +1 @@
1
+ export declare const useAllErrorFormats: () => (error: any, mutationName?: string) => any;
@@ -0,0 +1,2 @@
1
+ import { QueryClient } from '@tanstack/react-query';
2
+ export declare const useCreateQueryClient: () => () => QueryClient;
@@ -1,5 +1,5 @@
1
1
  import { PriceList, Quote } from '@bunnyapp/common';
2
- export declare const useToggleAddonPlan: (quote: Quote | undefined, addonPriceList: PriceList, selectedPriceList: PriceList, setIsAddonPlanLoading: React.Dispatch<React.SetStateAction<boolean>>) => {
2
+ export declare const useToggleAddonPlan: (quote: Quote | undefined, addonPriceListId: string, selectedPriceList: PriceList, setIsAddonPlanLoading: React.Dispatch<React.SetStateAction<boolean>>) => {
3
3
  isPending: boolean;
4
4
  addedQuoteChange: boolean;
5
5
  deleteQuoteChange: () => void;
@@ -87,5 +87,9 @@ declare const QueryKeyFactory: {
87
87
  priceListId: string | undefined;
88
88
  token?: string;
89
89
  }) => (string | undefined)[];
90
+ addonPlansKey: ({ priceListId, token }: {
91
+ priceListId: string;
92
+ token?: string;
93
+ }) => string[];
90
94
  };
91
95
  export default QueryKeyFactory;
@@ -0,0 +1,5 @@
1
+ import { Subscription } from '@bunnyapp/common';
2
+ export declare const ADDON_INDENTATION = 64;
3
+ export declare function findNonAddonSubscriptions(subscriptions: Subscription[]): Subscription[];
4
+ export declare function findAddonSubscriptions(parentSubscription: Subscription, subscriptions: Subscription[]): Subscription[];
5
+ export declare function addonPlanSwitchTestId(planName: string): string;
@@ -0,0 +1,8 @@
1
+ import { BillingPeriod } from '@/graphql-codegen/exportedScalarTypes';
2
+ type PriceListFragment = {
3
+ periodMonths: number | null | undefined;
4
+ };
5
+ export declare function getAddonsForBillingPeriod<TPlan extends {
6
+ priceLists: readonly (PriceListFragment & Record<string, any>)[];
7
+ }>(billingPeriod: BillingPeriod, addonPlans: TPlan[]): TPlan['priceLists'][number][];
8
+ export {};
@@ -0,0 +1,15 @@
1
+ import { BillingPeriod } from '@/graphql-codegen/exportedScalarTypes';
2
+ import { Subscription } from '@bunnyapp/common';
3
+ import { FragmentOf } from 'gql.tada';
4
+ export declare const hasUnpurchasedAddonPriceLists_PlanFragment: import("gql.tada").TadaDocumentNode<{
5
+ priceLists: {
6
+ id: string;
7
+ isVisible: boolean | null;
8
+ periodMonths: number | null;
9
+ }[];
10
+ }, {}, {
11
+ fragment: "hasUnpurchasedAddonPriceLists_PlanFragment";
12
+ on: "Plan";
13
+ masked: true;
14
+ }>;
15
+ export declare function hasUnpurchasedAddonPriceLists(maskedPriceListAddonPlans: FragmentOf<typeof hasUnpurchasedAddonPriceLists_PlanFragment>[], currentSubscription: Subscription | undefined, billingPeriod: BillingPeriod): boolean;
@@ -0,0 +1,11 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * Creates a context and provider for a state value
4
+ * @param useValue - A function that returns the state value
5
+ * @returns A tuple containing the provider and the context value
6
+ * @example take a look at how this is used in the quoteIdContext in the QuantityDrawer
7
+ */
8
+ export declare const createStateContext: <Value, State>(useValue: (init?: Value) => State) => readonly [({ initialValue, children, }: {
9
+ initialValue?: Value;
10
+ children?: ReactNode;
11
+ }) => import("react/jsx-runtime").JSX.Element, () => State & ({} | undefined)];
@@ -0,0 +1,14 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * Creates a context and provider for a value
4
+ * Unlike createStateContext, this accepts a value prop directly that can be updated
5
+ * @returns A tuple containing the provider and the context hook
6
+ * @example
7
+ * const [ValueProvider, useValue] = createValueContext<string>();
8
+ * // Usage: ValueProvider with value prop that updates when changed
9
+ * // In a child component: const value = useValue();
10
+ */
11
+ export declare const createValueContext: <Value>() => readonly [({ value, children }: {
12
+ value: Value;
13
+ children?: ReactNode;
14
+ }) => import("react/jsx-runtime").JSX.Element, () => Value & ({} | undefined)];
@@ -1,5 +1,4 @@
1
- import { PriceList, PriceListCharge, Quote, Subscription } from '@bunnyapp/common';
2
- export declare function isAddonPurchased(featureAddon: PriceListCharge, currentSubscription: Subscription | undefined): boolean;
1
+ import { PriceList, Quote, Subscription } from '@bunnyapp/common';
3
2
  export declare function hasUnpurchasedFeatureAddons(priceList: PriceList, currentSubscription: Subscription | undefined): boolean;
4
3
  export declare function findQuoteChangeForFeatureAddon(quote: Quote): import("@bunnyapp/common").QuoteChange | undefined;
5
4
  export declare function featureAddonInQuote(selectedPriceList: {
@@ -18,4 +17,4 @@ export declare function featureAddonInQuote(selectedPriceList: {
18
17
  }[];
19
18
  }[] | null;
20
19
  } | null): boolean;
21
- export declare function featureAddonSwitchTestId(featureAddon: PriceListCharge): string;
20
+ export declare function featureAddonSwitchTestId(addonName: string): string;
@@ -0,0 +1,24 @@
1
+ import { FragmentOf } from 'gql.tada';
2
+ export declare const isAddonPurchased_PriceListChargeFragment: import("gql.tada").TadaDocumentNode<{
3
+ id: string;
4
+ featureAddon: boolean | null;
5
+ }, {}, {
6
+ fragment: "isAddonPurchased_PriceListChargeFragment";
7
+ on: "PriceListCharge";
8
+ masked: true;
9
+ }>;
10
+ export declare const isAddonPurchased_SubscriptionChargeFragment: import("gql.tada").TadaDocumentNode<{
11
+ id: string;
12
+ charges: {
13
+ id: string | null;
14
+ priceListCharge: {
15
+ id: string;
16
+ featureAddon: boolean | null;
17
+ } | null;
18
+ }[] | null;
19
+ }, {}, {
20
+ fragment: "isAddonPurchased_SubscriptionChargeFragment";
21
+ on: "Subscription";
22
+ masked: true;
23
+ }>;
24
+ export declare function isAddonPurchased(maskedFeatureAddon: FragmentOf<typeof isAddonPurchased_PriceListChargeFragment>, maskedCurrentSubscription: FragmentOf<typeof isAddonPurchased_SubscriptionChargeFragment>): boolean;
@@ -1,7 +1,12 @@
1
- import { PricingModel } from '@/graphql-codegen/exportedScalarTypes';
2
- export declare function doesPriceListHaveFlatFeeCharges(priceList: {
1
+ import { FragmentOf } from 'gql.tada';
2
+ export declare const DoesPriceListHaveFlatFeeCharges_PriceListFragment: import("gql.tada").TadaDocumentNode<{
3
3
  charges: {
4
- pricingModel?: PricingModel;
5
- basePrice?: number;
6
- }[];
7
- }): boolean;
4
+ pricingModel: "FLAT" | "TIERED" | "VOLUME" | "BANDS" | null;
5
+ basePrice: number;
6
+ }[] | null;
7
+ }, {}, {
8
+ fragment: "DoesPriceListHaveFlatFeeCharges_PriceListFragment";
9
+ on: "PriceList";
10
+ masked: true;
11
+ }>;
12
+ export declare function doesPriceListHaveFlatFeeCharges(maskedPriceList: FragmentOf<typeof DoesPriceListHaveFlatFeeCharges_PriceListFragment>): boolean;
@@ -1,5 +1,11 @@
1
- export declare const getPrice: (priceList: {
2
- showPriceAsMonthly?: boolean;
3
- monthlyBasePrice?: number;
4
- basePrice?: number;
5
- }) => number | undefined;
1
+ import { FragmentOf } from 'gql.tada';
2
+ export declare const GetPrice_PriceListFragment: import("gql.tada").TadaDocumentNode<{
3
+ showPriceAsMonthly: boolean | null;
4
+ monthlyBasePrice: number | null;
5
+ basePrice: number | null;
6
+ }, {}, {
7
+ fragment: "GetPrice_PriceListFragment";
8
+ on: "PriceList";
9
+ masked: true;
10
+ }>;
11
+ export declare function getPrice(maskedPriceList: FragmentOf<typeof GetPrice_PriceListFragment>): number | null;
@@ -1,6 +1,6 @@
1
1
  export declare function priceDescriptionString({ unitName, showPriceAsMonthly, periodMonths, priceListHasFlatFeeCharges, }: {
2
- unitName?: string;
3
- showPriceAsMonthly?: boolean;
4
- periodMonths?: number;
2
+ unitName?: string | null;
3
+ showPriceAsMonthly: boolean | null;
4
+ periodMonths: number | null;
5
5
  priceListHasFlatFeeCharges: boolean;
6
6
  }): string;
@@ -1,12 +1,19 @@
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;
1
+ import { FragmentOf } from 'gql.tada';
2
+ export declare const PriceListPriceText_PriceListFragment: import("gql.tada").TadaDocumentNode<{
3
+ id: string;
4
+ plan: {
5
+ id: string;
6
+ pricingStyle: "PRICED" | "FREE" | "CONTACT_US";
7
+ } | null;
8
+ currencyId: string;
9
+ [$tada.fragmentRefs]: {
10
+ GetPrice_PriceListFragment: "PriceList";
11
11
  };
12
+ }, {}, {
13
+ fragment: "PriceListPriceText_PriceListFragment";
14
+ on: "PriceList";
15
+ masked: true;
16
+ }>;
17
+ export declare function priceListPriceText({ priceList: maskedPriceList, }: {
18
+ priceList: FragmentOf<typeof PriceListPriceText_PriceListFragment>;
12
19
  }): string | number;
@@ -1,5 +1,5 @@
1
1
  import { Plan, Product } from '@bunnyapp/common';
2
2
  import { BillingPeriod } from '@/graphql-codegen/exportedScalarTypes';
3
- export declare const periodMonthsConverter: (period?: number) => "ONCE" | "MONTHLY" | "QUARTERLY" | "SEMI_ANNUAL" | "ANNUAL";
4
- export declare const billingPeriodConverter: (period?: BillingPeriod) => 1 | 0 | 3 | 6 | 12;
3
+ export declare const periodMonthsConverter: (period: number | null) => "ONCE" | "MONTHLY" | "QUARTERLY" | "SEMI_ANNUAL" | "ANNUAL" | null;
4
+ export declare const billingPeriodConverter: (period?: BillingPeriod) => 0 | 1 | 3 | 6 | 12;
5
5
  export declare const createAvailableBillingPeriods: (plans?: Plan[], selectedProduct?: Product) => (0 | 1 | 3 | 6 | 12)[] | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bunnyapp/components",
3
- "version": "1.6.0-beta.15",
3
+ "version": "1.6.0-beta.17",
4
4
  "description": "Components from the Bunny portal to embed Bunny UI functionality into your application.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -1,11 +0,0 @@
1
- import { Plan, PriceList, Subscription } from '@bunnyapp/common';
2
- import { BillingPeriod } from '@/graphql-codegen/exportedScalarTypes';
3
- type PlanAddonsCardProps = {
4
- selectedPriceList: PriceList;
5
- subscriptions: Subscription[];
6
- addonPlans: Plan[];
7
- selectedBillingPeriod: BillingPeriod;
8
- className?: string;
9
- };
10
- declare const PlanAddonsCard: ({ selectedPriceList, subscriptions, addonPlans, selectedBillingPeriod, className, }: PlanAddonsCardProps) => import("react/jsx-runtime").JSX.Element;
11
- export default PlanAddonsCard;
@@ -1,37 +0,0 @@
1
- import { Plan } from '@bunnyapp/common';
2
- declare const getAddonPlans: ({ token, id, apiHost, }: {
3
- token?: string;
4
- id: string;
5
- apiHost: string;
6
- }) => Promise<{
7
- priceLists: import("@bunnyapp/common").PriceList[];
8
- addon?: boolean;
9
- compatiblePlans?: Plan[];
10
- addonPlans?: Plan[];
11
- availableFrom?: string;
12
- availableTo?: string;
13
- basePrice?: number;
14
- code?: string;
15
- contactUsLabel?: string;
16
- contactUsUrl?: string;
17
- createdAt: string;
18
- description?: string;
19
- features?: import("@bunnyapp/common").Feature[];
20
- id: string;
21
- internalNotes?: string;
22
- isAvailableNow?: boolean;
23
- isVisible?: boolean;
24
- name: string;
25
- planFeatures?: import("@bunnyapp/common").PlanFeature[];
26
- position: number;
27
- pricingDescription?: string;
28
- pricingStyle: import("@bunnyapp/common").PricingStyle;
29
- product: import("@bunnyapp/common").Product;
30
- productId: string;
31
- selfServiceBuy?: boolean;
32
- selfServiceCancel?: boolean;
33
- selfServiceRenew?: boolean;
34
- trialEndDate?: string;
35
- updatedAt: string;
36
- }[]>;
37
- export default getAddonPlans;
@@ -1,2 +0,0 @@
1
- import { GraphQLClient } from "graphql-request";
2
- export declare const createGraphQLClient: (apiHost: string, token?: string) => GraphQLClient;
@@ -1,8 +0,0 @@
1
- import { Plan, PriceList, Subscription } from '@bunnyapp/common';
2
- import { BillingPeriod } from '@/graphql-codegen/exportedScalarTypes';
3
- export declare const ADDON_INDENTATION = 64;
4
- export declare function findNonAddonSubscriptions(subscriptions: Subscription[]): Subscription[];
5
- export declare function findAddonSubscriptions(parentSubscription: Subscription, subscriptions: Subscription[]): Subscription[];
6
- export declare function hasUnpurchasedAddonPriceLists(priceListAddonPlans: Plan[], currentSubscription: Subscription | undefined, billingPeriod: BillingPeriod): boolean;
7
- export declare function addonPlanSwitchTestId(addonPlan: Plan): string;
8
- export declare function getAddonsForBillingPeriod(billingPeriod: BillingPeriod, addonPlans: Plan[]): PriceList[];
@@ -1,11 +0,0 @@
1
- import { Plan, PriceList, Subscription } from '@bunnyapp/common';
2
- import { BillingPeriod } from '@/graphql-codegen/exportedScalarTypes';
3
- type PlanAddonsCardProps = {
4
- selectedPriceList: PriceList;
5
- subscriptions: Subscription[];
6
- addonPlans: Plan[];
7
- selectedBillingPeriod: BillingPeriod;
8
- className?: string;
9
- };
10
- declare const PlanAddonsCard: ({ selectedPriceList, subscriptions, addonPlans, selectedBillingPeriod, className, }: PlanAddonsCardProps) => import("react/jsx-runtime").JSX.Element;
11
- export default PlanAddonsCard;
@@ -1,37 +0,0 @@
1
- import { Plan } from '@bunnyapp/common';
2
- declare const getAddonPlans: ({ token, id, apiHost, }: {
3
- token?: string;
4
- id: string;
5
- apiHost: string;
6
- }) => Promise<{
7
- priceLists: import("@bunnyapp/common").PriceList[];
8
- addon?: boolean;
9
- compatiblePlans?: Plan[];
10
- addonPlans?: Plan[];
11
- availableFrom?: string;
12
- availableTo?: string;
13
- basePrice?: number;
14
- code?: string;
15
- contactUsLabel?: string;
16
- contactUsUrl?: string;
17
- createdAt: string;
18
- description?: string;
19
- features?: import("@bunnyapp/common").Feature[];
20
- id: string;
21
- internalNotes?: string;
22
- isAvailableNow?: boolean;
23
- isVisible?: boolean;
24
- name: string;
25
- planFeatures?: import("@bunnyapp/common").PlanFeature[];
26
- position: number;
27
- pricingDescription?: string;
28
- pricingStyle: import("@bunnyapp/common").PricingStyle;
29
- product: import("@bunnyapp/common").Product;
30
- productId: string;
31
- selfServiceBuy?: boolean;
32
- selfServiceCancel?: boolean;
33
- selfServiceRenew?: boolean;
34
- trialEndDate?: string;
35
- updatedAt: string;
36
- }[]>;
37
- export default getAddonPlans;
@@ -1,2 +0,0 @@
1
- import { GraphQLClient } from "graphql-request";
2
- export declare const createGraphQLClient: (apiHost: string, token?: string) => GraphQLClient;
@@ -1,8 +0,0 @@
1
- import { Plan, PriceList, Subscription } from '@bunnyapp/common';
2
- import { BillingPeriod } from '@/graphql-codegen/exportedScalarTypes';
3
- export declare const ADDON_INDENTATION = 64;
4
- export declare function findNonAddonSubscriptions(subscriptions: Subscription[]): Subscription[];
5
- export declare function findAddonSubscriptions(parentSubscription: Subscription, subscriptions: Subscription[]): Subscription[];
6
- export declare function hasUnpurchasedAddonPriceLists(priceListAddonPlans: Plan[], currentSubscription: Subscription | undefined, billingPeriod: BillingPeriod): boolean;
7
- export declare function addonPlanSwitchTestId(addonPlan: Plan): string;
8
- export declare function getAddonsForBillingPeriod(billingPeriod: BillingPeriod, addonPlans: Plan[]): PriceList[];