@bunnyapp/components 1.4.0 → 1.5.0-beta.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 (140) hide show
  1. package/dist/cjs/index.js +1458 -1007
  2. package/dist/cjs/src/components/BunnyProvider.d.ts +0 -1
  3. package/dist/cjs/src/components/Checkout/Checkout.d.ts +12 -6
  4. package/dist/cjs/src/components/Invoice/Invoice.d.ts +5 -2
  5. package/dist/cjs/src/components/PaymentForm/PaymentForm.d.ts +1 -2
  6. package/dist/cjs/src/components/PaymentForm/PaymentFormTypes.d.ts +1 -11
  7. package/dist/cjs/src/components/Quote/Quote.d.ts +1 -1
  8. package/dist/cjs/src/components/Quote/Quote.stories.d.ts +5 -0
  9. package/dist/cjs/src/components/QuoteProvider.d.ts +22 -0
  10. package/dist/cjs/src/components/Subscriptions/AddonIndentation.d.ts +8 -0
  11. package/dist/cjs/src/components/Subscriptions/AddonSubscriptionCards.d.ts +7 -0
  12. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/PriceListGrid.d.ts +4 -3
  13. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/CheckoutBarInput.d.ts +3 -4
  14. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/CheckoutBarSummarySection.d.ts +2 -3
  15. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/CheckoutButton.d.ts +2 -1
  16. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/PlanPickerCheckoutBar.d.ts +5 -6
  17. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/EverythingPlanFeatures.d.ts +2 -1
  18. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/PlanAddonsCard.d.ts +11 -0
  19. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/PriceListCardDesktop.d.ts +5 -3
  20. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/PriceListGridDesktop.d.ts +4 -3
  21. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/planManagerUtils.d.ts +2 -2
  22. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerMobile/PriceListCardMobile.d.ts +3 -3
  23. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerMobile/PriceListGridMobile.d.ts +3 -3
  24. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCard.d.ts +4 -2
  25. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCardButton.d.ts +2 -2
  26. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCardPrice.d.ts +2 -1
  27. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCardTitle.d.ts +1 -1
  28. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/priceListCardUtils.d.ts +1 -2
  29. package/dist/{esm/src/components/Subscriptions/PlanManager/PlanPicker → cjs/src/components/Subscriptions/PlanManager/PlanPicker/priceListSelector}/PriceListSelector.d.ts +2 -4
  30. package/dist/cjs/src/components/Subscriptions/QuantityDrawerContainer.d.ts +14 -0
  31. package/dist/cjs/src/components/Subscriptions/quantityChangeDrawer/QuantityChangeGridRow.d.ts +4 -2
  32. package/dist/cjs/src/components/Subscriptions/quantityChangeDrawer/QuantityInput.d.ts +4 -2
  33. package/dist/cjs/src/components/Subscriptions/quantityChangeDrawer/quantityChangeDrawerDesktop/QuantityChangeDrawerDesktop.d.ts +3 -1
  34. package/dist/cjs/src/components/Subscriptions/subscriptionsList/ChangeQuantitiesButton.d.ts +2 -3
  35. package/dist/cjs/src/components/Subscriptions/subscriptionsList/SubscriptionCardActions.d.ts +4 -3
  36. package/dist/cjs/src/components/Subscriptions/subscriptionsList/SubscriptionCardHeader.d.ts +2 -3
  37. package/dist/cjs/src/components/Subscriptions/subscriptionsList/SubscriptionsList.d.ts +2 -3
  38. package/dist/cjs/src/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionCardDesktop.d.ts +3 -3
  39. package/dist/cjs/src/components/Subscriptions/subscriptionsList/subscriptionUtils.d.ts +1 -1
  40. package/dist/cjs/src/components/Transactions/Transactions.d.ts +5 -3
  41. package/dist/cjs/src/components/Transactions/transactionsList/TransactionsListDesktop.d.ts +1 -1
  42. package/dist/cjs/src/components/Transactions/transactionsList/TransactionsListMobile.d.ts +1 -1
  43. package/dist/cjs/src/components/Transactions/transactionsList/utils.d.ts +1 -1
  44. package/dist/cjs/src/{components/Invoice → contexts}/InvoiceQuoteContext.d.ts +2 -2
  45. package/dist/{esm/src/components/Subscriptions → cjs/src/contexts}/SubscriptionsContext.d.ts +0 -4
  46. package/dist/{esm/src/components/Transactions → cjs/src/contexts}/TransactionsListContext.d.ts +3 -2
  47. package/dist/cjs/src/graphql/QuoteRequests.d.ts +17 -2
  48. package/dist/cjs/src/graphql/mutations/quoteAddonCreate.d.ts +7 -0
  49. package/dist/cjs/src/graphql/mutations/quoteChangeCreate.d.ts +8 -0
  50. package/dist/cjs/src/graphql/mutations/quoteChangeDelete.d.ts +6 -0
  51. package/dist/cjs/src/graphql/mutations/quoteChargeDelete.d.ts +2 -1
  52. package/dist/cjs/src/graphql/mutations/quoteChargeUpdate.d.ts +2 -1
  53. package/dist/cjs/src/graphql/mutations/quoteCompose.d.ts +0 -1
  54. package/dist/cjs/src/graphql/mutations/quoteCreate.d.ts +8 -0
  55. package/dist/cjs/src/graphql/mutations/quoteCreateWithDeal.d.ts +10 -0
  56. package/dist/cjs/src/graphql/queries/getAddonPlans.d.ts +7 -0
  57. package/dist/cjs/src/graphql/queries/getFormattedQuote.d.ts +2 -1
  58. package/dist/cjs/src/graphql/queries/getQuote.d.ts +3 -1
  59. package/dist/cjs/src/hooks/quotes/useQuoteCreate.d.ts +9 -0
  60. package/dist/cjs/src/hooks/quotes/useQuoteQuantities.d.ts +14 -0
  61. package/dist/cjs/src/hooks/quotes/useQuoteUpdateFeatureAddon.d.ts +2 -3
  62. package/dist/cjs/src/hooks/useCurrentUserData.d.ts +11 -8
  63. package/dist/cjs/src/hooks/usePaymentMethod.d.ts +2 -1
  64. package/dist/cjs/src/hooks/usePriceListChangeOptions.d.ts +6 -0
  65. package/dist/cjs/src/hooks/useToggleAddonQuoteChange.d.ts +7 -0
  66. package/dist/cjs/src/utils/addonPlanUtils.d.ts +6 -0
  67. package/dist/cjs/src/utils/chargeUtils.d.ts +2 -0
  68. package/dist/cjs/src/utils/featureAddonUtils.d.ts +5 -2
  69. package/dist/esm/index.js +1460 -1009
  70. package/dist/esm/src/components/BunnyProvider.d.ts +0 -1
  71. package/dist/esm/src/components/Checkout/Checkout.d.ts +12 -6
  72. package/dist/esm/src/components/Invoice/Invoice.d.ts +5 -2
  73. package/dist/esm/src/components/PaymentForm/PaymentForm.d.ts +1 -2
  74. package/dist/esm/src/components/PaymentForm/PaymentFormTypes.d.ts +1 -11
  75. package/dist/esm/src/components/Quote/Quote.d.ts +1 -1
  76. package/dist/esm/src/components/Quote/Quote.stories.d.ts +5 -0
  77. package/dist/esm/src/components/QuoteProvider.d.ts +22 -0
  78. package/dist/esm/src/components/Subscriptions/AddonIndentation.d.ts +8 -0
  79. package/dist/esm/src/components/Subscriptions/AddonSubscriptionCards.d.ts +7 -0
  80. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/PriceListGrid.d.ts +4 -3
  81. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/CheckoutBarInput.d.ts +3 -4
  82. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/CheckoutBarSummarySection.d.ts +2 -3
  83. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/CheckoutButton.d.ts +2 -1
  84. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/PlanPickerCheckoutBar.d.ts +5 -6
  85. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/EverythingPlanFeatures.d.ts +2 -1
  86. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/PlanAddonsCard.d.ts +11 -0
  87. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/PriceListCardDesktop.d.ts +5 -3
  88. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/PriceListGridDesktop.d.ts +4 -3
  89. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/planManagerUtils.d.ts +2 -2
  90. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerMobile/PriceListCardMobile.d.ts +3 -3
  91. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerMobile/PriceListGridMobile.d.ts +3 -3
  92. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCard.d.ts +4 -2
  93. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCardButton.d.ts +2 -2
  94. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCardPrice.d.ts +2 -1
  95. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCardTitle.d.ts +1 -1
  96. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/priceListCardUtils.d.ts +1 -2
  97. package/dist/{cjs/src/components/Subscriptions/PlanManager/PlanPicker → esm/src/components/Subscriptions/PlanManager/PlanPicker/priceListSelector}/PriceListSelector.d.ts +2 -4
  98. package/dist/esm/src/components/Subscriptions/QuantityDrawerContainer.d.ts +14 -0
  99. package/dist/esm/src/components/Subscriptions/quantityChangeDrawer/QuantityChangeGridRow.d.ts +4 -2
  100. package/dist/esm/src/components/Subscriptions/quantityChangeDrawer/QuantityInput.d.ts +4 -2
  101. package/dist/esm/src/components/Subscriptions/quantityChangeDrawer/quantityChangeDrawerDesktop/QuantityChangeDrawerDesktop.d.ts +3 -1
  102. package/dist/esm/src/components/Subscriptions/subscriptionsList/ChangeQuantitiesButton.d.ts +2 -3
  103. package/dist/esm/src/components/Subscriptions/subscriptionsList/SubscriptionCardActions.d.ts +4 -3
  104. package/dist/esm/src/components/Subscriptions/subscriptionsList/SubscriptionCardHeader.d.ts +2 -3
  105. package/dist/esm/src/components/Subscriptions/subscriptionsList/SubscriptionsList.d.ts +2 -3
  106. package/dist/esm/src/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionCardDesktop.d.ts +3 -3
  107. package/dist/esm/src/components/Subscriptions/subscriptionsList/subscriptionUtils.d.ts +1 -1
  108. package/dist/esm/src/components/Transactions/Transactions.d.ts +5 -3
  109. package/dist/esm/src/components/Transactions/transactionsList/TransactionsListDesktop.d.ts +1 -1
  110. package/dist/esm/src/components/Transactions/transactionsList/TransactionsListMobile.d.ts +1 -1
  111. package/dist/esm/src/components/Transactions/transactionsList/utils.d.ts +1 -1
  112. package/dist/esm/src/{components/Invoice → contexts}/InvoiceQuoteContext.d.ts +2 -2
  113. package/dist/{cjs/src/components/Subscriptions → esm/src/contexts}/SubscriptionsContext.d.ts +0 -4
  114. package/dist/{cjs/src/components/Transactions → esm/src/contexts}/TransactionsListContext.d.ts +3 -2
  115. package/dist/esm/src/graphql/QuoteRequests.d.ts +17 -2
  116. package/dist/esm/src/graphql/mutations/quoteAddonCreate.d.ts +7 -0
  117. package/dist/esm/src/graphql/mutations/quoteChangeCreate.d.ts +8 -0
  118. package/dist/esm/src/graphql/mutations/quoteChangeDelete.d.ts +6 -0
  119. package/dist/esm/src/graphql/mutations/quoteChargeDelete.d.ts +2 -1
  120. package/dist/esm/src/graphql/mutations/quoteChargeUpdate.d.ts +2 -1
  121. package/dist/esm/src/graphql/mutations/quoteCompose.d.ts +0 -1
  122. package/dist/esm/src/graphql/mutations/quoteCreate.d.ts +8 -0
  123. package/dist/esm/src/graphql/mutations/quoteCreateWithDeal.d.ts +10 -0
  124. package/dist/esm/src/graphql/queries/getAddonPlans.d.ts +7 -0
  125. package/dist/esm/src/graphql/queries/getFormattedQuote.d.ts +2 -1
  126. package/dist/esm/src/graphql/queries/getQuote.d.ts +3 -1
  127. package/dist/esm/src/hooks/quotes/useQuoteCreate.d.ts +9 -0
  128. package/dist/esm/src/hooks/quotes/useQuoteQuantities.d.ts +14 -0
  129. package/dist/esm/src/hooks/quotes/useQuoteUpdateFeatureAddon.d.ts +2 -3
  130. package/dist/esm/src/hooks/useCurrentUserData.d.ts +11 -8
  131. package/dist/esm/src/hooks/usePaymentMethod.d.ts +2 -1
  132. package/dist/esm/src/hooks/usePriceListChangeOptions.d.ts +6 -0
  133. package/dist/esm/src/hooks/useToggleAddonQuoteChange.d.ts +7 -0
  134. package/dist/esm/src/utils/addonPlanUtils.d.ts +6 -0
  135. package/dist/esm/src/utils/chargeUtils.d.ts +2 -0
  136. package/dist/esm/src/utils/featureAddonUtils.d.ts +5 -2
  137. package/dist/index.d.ts +8 -4
  138. package/package.json +2 -2
  139. package/dist/cjs/src/components/QuotePreviewProvider.d.ts +0 -17
  140. package/dist/esm/src/components/QuotePreviewProvider.d.ts +0 -17
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { ShadowType } from "../../types/shadowType";
3
- import { FormattedInvoice, FormattedQuote } from "@bunnyapp/common";
2
+ import { ShadowType } from '../types/shadowType';
3
+ import { FormattedInvoice, FormattedQuote } from '@bunnyapp/common';
4
4
  export type InvoiceQuoteContextProps = {
5
5
  id?: string;
6
6
  invoiceQuoteViewComponent?: React.ReactNode;
@@ -11,9 +11,5 @@ export type SubscriptionsContextValues = {
11
11
  hideExpired?: boolean;
12
12
  upgradingSubscription?: Subscription;
13
13
  setUpgradingSubscription: React.Dispatch<React.SetStateAction<Subscription | undefined>>;
14
- updatingChargeQuantityId?: string;
15
- setUpdatingChargeQuantityId: React.Dispatch<React.SetStateAction<string | undefined>>;
16
- subscriptionUpgradeId: string | null;
17
- setSubscriptionUpgradeId: React.Dispatch<React.SetStateAction<string | null>>;
18
14
  };
19
15
  export declare const SubscriptionsContext: import("react").Context<SubscriptionsContextValues>;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { Transaction, TransactionKind } from '@bunnyapp/common';
3
- import { ShadowType } from '../../types/shadowType';
4
- import { TransactionListColumnType } from './transactionsList/TransactionsListDesktop';
3
+ import { ShadowType } from '../types/shadowType';
4
+ import { TransactionListColumnType } from '../components/Transactions/transactionsList/TransactionsListDesktop';
5
5
  export type TransactionsContextValues = {
6
6
  showSearchBar?: boolean;
7
7
  showTitle?: boolean;
@@ -24,6 +24,7 @@ export type TransactionsContextValues = {
24
24
  filterTransactions?: (transaction: Transaction) => boolean;
25
25
  sortTransactions?: (transactionA: Transaction, transactionB: Transaction) => number;
26
26
  transactionDateType: TransactionDateType;
27
+ hidePaymentForm?: boolean;
27
28
  };
28
29
  export type TransactionDateType = 'createdAt' | 'issuedAt' | 'dueAt';
29
30
  export declare const TransactionsListContext: import("react").Context<TransactionsContextValues>;
@@ -1,8 +1,23 @@
1
- export declare const useQuoteSubscriptionUpgrade: () => (subscriptionId: string, priceListId: string, apiHost: string, token?: string) => Promise<unknown>;
1
+ export declare const quoteSubscriptionUpgrade: ({ subscriptionId, priceListId, apiHost, token, }: {
2
+ subscriptionId: string;
3
+ priceListId: string;
4
+ apiHost: string;
5
+ token?: string | undefined;
6
+ }) => Promise<unknown>;
2
7
  export declare const useCreateSubscriptionQuote: () => (subscriptionIds: string[], apiHost: string, token?: string) => Promise<unknown>;
3
8
  export declare const useQuoteChangeUpdate: () => (charges: {
4
9
  id: string;
5
10
  quantity: number;
6
11
  }[], quoteChangeId: string, apiHost: string, token?: string) => Promise<unknown>;
7
12
  export declare const useQuoteDelete: () => (quoteId: string, apiHost: string, token?: string) => Promise<unknown>;
8
- export declare const useQuoteSubscriptionActivate: () => (subscriptionId: string, apiHost: string, token?: string) => Promise<unknown>;
13
+ export declare const quoteSubscriptionAddon: ({ subscriptionId, priceListId, apiHost, token, }: {
14
+ subscriptionId: string;
15
+ priceListId?: string | undefined;
16
+ apiHost: string;
17
+ token?: string | undefined;
18
+ }) => Promise<unknown>;
19
+ export declare const quoteSubscriptionActivate: ({ subscriptionId, apiHost, token, }: {
20
+ subscriptionId: string;
21
+ apiHost: string;
22
+ token?: string | undefined;
23
+ }) => Promise<unknown>;
@@ -0,0 +1,7 @@
1
+ declare const quoteChangeCreate: ({ parentQuoteChangeId, priceListId, apiHost, token, }: {
2
+ parentQuoteChangeId: string | null;
3
+ priceListId: string | null;
4
+ apiHost: string;
5
+ token?: string | undefined;
6
+ }) => Promise<any>;
7
+ export default quoteChangeCreate;
@@ -0,0 +1,8 @@
1
+ declare const quoteChangeCreate: ({ parentQuoteChangeId, priceListId, apiHost, token, quoteId, }: {
2
+ parentQuoteChangeId: string | null;
3
+ priceListId: string | null;
4
+ apiHost: string;
5
+ token?: string | undefined;
6
+ quoteId: string;
7
+ }) => Promise<any>;
8
+ export default quoteChangeCreate;
@@ -0,0 +1,6 @@
1
+ declare const quoteChangeDelete: ({ id, apiHost, token, }: {
2
+ id: string;
3
+ apiHost: string;
4
+ token?: string | undefined;
5
+ }) => Promise<any>;
6
+ export default quoteChangeDelete;
@@ -1,7 +1,8 @@
1
+ import { QuoteCharge } from '@bunnyapp/common';
1
2
  type QuoteChargeDeleteProps = {
2
3
  apiHost: string;
3
4
  quoteChargeId: string;
4
5
  token?: string;
5
6
  };
6
- declare const quoteChargeDelete: ({ quoteChargeId, token, apiHost }: QuoteChargeDeleteProps) => Promise<unknown>;
7
+ declare const quoteChargeDelete: ({ quoteChargeId, token, apiHost }: QuoteChargeDeleteProps) => Promise<QuoteCharge>;
7
8
  export default quoteChargeDelete;
@@ -1,3 +1,4 @@
1
+ import { QuoteCharge } from '@bunnyapp/common';
1
2
  declare const quoteChargeUpdate: ({ discount, name, price, quantity, quoteChargeId, startDate, subtotal, apiHost, token, }: {
2
3
  discount?: number | undefined;
3
4
  name?: string | undefined;
@@ -8,5 +9,5 @@ declare const quoteChargeUpdate: ({ discount, name, price, quantity, quoteCharge
8
9
  subtotal?: number | undefined;
9
10
  apiHost: string;
10
11
  token: string;
11
- }) => Promise<unknown>;
12
+ }) => Promise<QuoteCharge>;
12
13
  export default quoteChargeUpdate;
@@ -1,5 +1,4 @@
1
1
  import { Quote } from '@bunnyapp/common';
2
- export declare const QUOTE_FIELDS = "quote {\n formattedQuote {\n html\n }\n acceptedByName\n acceptedByTitle\n accountId\n amount\n amountDue\n applicationDate\n applied\n billingDay\n contactId\n createdAt\n credits\n currencyId\n dealId\n discount\n discountValue\n endDate\n evergreen\n expiresAt\n id\n invoiceUntil\n isPendingApprovalRequest\n kind\n message\n name\n netPaymentDays\n notes\n ownerId\n periodAmount\n poNumber\n requiresApproval\n startDate\n state\n subtotal\n taxAmount\n updatedAt\n uuid\n amountsByPeriod {\n amount\n id\n name\n }\n endDateOptions {\n endDate\n label\n }\n invoiceUntilOptions {\n endDate\n label\n }\n quoteChanges {\n currencyId\n id\n kind\n charges {\n amountsByPeriod {\n amount\n startDate\n }\n amount\n billingPeriod\n billingPeriodAmounts { id amount prorationRate }\n chargeType\n couponId\n createdAt\n currencyId\n discount\n endDate\n feature { id name code isUnit unitName }\n id\n name\n priceListCharge {\n id\n }\n priceList {\n id\n }\n couponId\n price\n priceDecimals\n priceTiers { starts price }\n pricingModel\n prorationRate\n quantity\n quantityMax\n quantityMin\n startDate\n tieredAveragePrice\n updatedAt\n kind\n }\n priceList {\n id\n plan {\n name\n }\n product {\n name\n }\n }\n }\n}";
3
2
  type Options = {
4
3
  quoteId?: string;
5
4
  priceListId?: string;
@@ -0,0 +1,8 @@
1
+ import { Quote } from '@bunnyapp/common';
2
+ type Options = {
3
+ attributes: any;
4
+ token?: string;
5
+ apiHost: string;
6
+ };
7
+ declare const quoteCreate: ({ attributes, token, apiHost }: Options) => Promise<Quote>;
8
+ export default quoteCreate;
@@ -0,0 +1,10 @@
1
+ import { Quote } from '@bunnyapp/common';
2
+ type Options = {
3
+ dealAttributes: any;
4
+ quoteAttributes: any;
5
+ token?: string;
6
+ apiHost: string;
7
+ accountId: string;
8
+ };
9
+ declare const quoteCreateWithDeal: ({ dealAttributes, quoteAttributes, accountId, token, apiHost, }: Options) => Promise<Quote>;
10
+ export default quoteCreateWithDeal;
@@ -0,0 +1,7 @@
1
+ import { Plan } from '@bunnyapp/common';
2
+ declare const getAddonPlans: ({ token, id, apiHost, }: {
3
+ token?: string | undefined;
4
+ id: string;
5
+ apiHost: string;
6
+ }) => Promise<Plan[]>;
7
+ export default getAddonPlans;
@@ -1,5 +1,6 @@
1
- declare const getFormattedQuote: ({ token, apiHost }: {
1
+ declare const getFormattedQuote: ({ token, apiHost, id, }: {
2
2
  apiHost: string;
3
3
  token?: string | undefined;
4
+ id?: string | undefined;
4
5
  }) => Promise<any>;
5
6
  export default getFormattedQuote;
@@ -1,7 +1,9 @@
1
1
  import { Quote } from '@bunnyapp/common';
2
- declare const getQuote: ({ id, token, apiHost, }: {
2
+ export declare const QUOTE_FIELDS: (removeFormattedQuoteField?: boolean) => string;
3
+ declare const getQuote: ({ id, token, apiHost, removeFormattedQuoteField, }: {
3
4
  id: string;
4
5
  token?: string | undefined;
5
6
  apiHost: string;
7
+ removeFormattedQuoteField?: boolean | undefined;
6
8
  }) => Promise<Quote>;
7
9
  export default getQuote;
@@ -0,0 +1,9 @@
1
+ import { PriceList, Quote, Subscription } from '@bunnyapp/common';
2
+ export declare const useQuoteCreate: ({ upgradingSubscription, selectedPriceList, token, }: {
3
+ upgradingSubscription?: Subscription | undefined;
4
+ selectedPriceList?: PriceList | undefined;
5
+ token?: string | undefined;
6
+ }) => {
7
+ quote: Quote | undefined;
8
+ isQuotePending: boolean;
9
+ };
@@ -0,0 +1,14 @@
1
+ import { PriceList, Quote } from '@bunnyapp/common';
2
+ export declare const useQuoteQuantities: ({ selectedPriceList, quote, }: {
3
+ selectedPriceList: PriceList;
4
+ quote?: Quote | undefined;
5
+ }) => {
6
+ onChangeQuantity: (priceListChargeId: string, quantity: number) => void;
7
+ getFeatureQuantity: (featureId: string) => number | undefined;
8
+ isUpdatingCharges: boolean;
9
+ };
10
+ /**
11
+ * Hook to manage feature quantities using a dictionary keyed by feature ID
12
+ * This tracks quantities for each unique feature.
13
+ */
14
+ export type FeatureQuantitiesDict = Record<string, number | undefined>;
@@ -1,8 +1,7 @@
1
- import { PriceListCharge } from '@bunnyapp/common';
2
- export declare const useQuoteUpdateFeatureAddon: (quoteId: string | undefined, featureAddon: PriceListCharge) => {
1
+ import { PriceListCharge, Quote } from '@bunnyapp/common';
2
+ export declare const useQuoteUpdateFeatureAddon: (quote: Quote | undefined, featureAddon: PriceListCharge) => {
3
3
  handleAddFeatureAddon: () => void;
4
4
  handleRemoveFeatureAddon: () => void;
5
5
  isPending: boolean;
6
6
  isChecked: boolean;
7
- editingQuoteLoaded: boolean;
8
7
  };
@@ -1,11 +1,14 @@
1
1
  import { currentUser as CurrentUser } from '@bunnyapp/common';
2
2
  declare const useCurrentUserData: (token: string | undefined) => {
3
- authObjectName: any;
4
- account: any;
5
- companyName: any;
6
- returnUrl: any;
7
- privacyUrl: any;
8
- termsUrl: any;
9
- entityId: any;
10
- } | CurrentUser;
3
+ currentUser: {
4
+ authObjectName: any;
5
+ account: any;
6
+ companyName: any;
7
+ returnUrl: any;
8
+ privacyUrl: any;
9
+ termsUrl: any;
10
+ entityId: any;
11
+ } | CurrentUser;
12
+ isCurrentUserDataLoading: boolean;
13
+ };
11
14
  export default useCurrentUserData;
@@ -1,8 +1,9 @@
1
1
  import { PaymentMethod } from '@bunnyapp/common';
2
- export declare const usePaymentMethod: ({ accountId, token, apiHost, }: {
2
+ export declare const usePaymentMethod: ({ accountId, token, apiHost, enabled, }: {
3
3
  accountId?: string | undefined;
4
4
  token?: string | undefined;
5
5
  apiHost: string;
6
+ enabled?: boolean | undefined;
6
7
  }) => {
7
8
  paymentMethods: PaymentMethod[];
8
9
  defaultPaymentMethod: PaymentMethod | undefined;
@@ -0,0 +1,6 @@
1
+ import { Subscription } from '@bunnyapp/common';
2
+ declare const usePriceListChangeOptions: (onChangePlanClick?: ((subscription: Subscription) => void) | undefined) => {
3
+ priceListChangeOptions: any;
4
+ arePriceListChangeOptionsLoading: boolean;
5
+ };
6
+ export default usePriceListChangeOptions;
@@ -0,0 +1,7 @@
1
+ import { Plan, PriceList, Quote } from '@bunnyapp/common';
2
+ export declare const useToggleAddonPlan: (quote: Quote | undefined, plan: Plan, billingPeriod: number, selectedPriceList: PriceList, setIsAddonPlanLoading: React.Dispatch<React.SetStateAction<boolean>>) => {
3
+ isPending: boolean;
4
+ addedQuoteChange: boolean;
5
+ deleteQuoteChange: () => void;
6
+ addAddonQuoteChange: () => void;
7
+ };
@@ -0,0 +1,6 @@
1
+ import { Plan, PriceList, 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 hasUnpurchasedAddonPlans(priceList: PriceList, currentSubscription: Subscription | undefined): boolean | undefined;
6
+ export declare function addonPlanSwitchTestId(addonPlan: Plan): string;
@@ -0,0 +1,2 @@
1
+ import { PriceListCharge } from '@bunnyapp/common';
2
+ export declare function canEditChargeQuantity(charge: PriceListCharge): boolean;
@@ -1,3 +1,6 @@
1
- import { PriceList, PriceListCharge, Subscription } from '@bunnyapp/common';
1
+ import { PriceList, PriceListCharge, Quote, Subscription } from '@bunnyapp/common';
2
2
  export declare function isAddonPurchased(featureAddon: PriceListCharge, currentSubscription: Subscription | undefined): boolean;
3
- export declare function priceListHasUnpurchasedFeatureAddons(priceList: PriceList, currentSubscription: Subscription | undefined): boolean;
3
+ export declare function hasUnpurchasedFeatureAddons(priceList: PriceList, currentSubscription: Subscription | undefined): boolean;
4
+ export declare function findQuoteChangeForFeatureAddon(quote: Quote): import("@bunnyapp/common").QuoteChange | undefined;
5
+ export declare function featureAddonInQuote(selectedPriceList: PriceList, priceListCharge: PriceListCharge, quote?: Quote): boolean;
6
+ export declare function featureAddonSwitchTestId(featureAddon: PriceListCharge): string;
package/dist/index.d.ts CHANGED
@@ -22,7 +22,10 @@ type InvoiceQuoteContextProps = {
22
22
  onQuoteLoaded?: (formattedQuote: FormattedQuote) => void;
23
23
  };
24
24
 
25
- declare function Invoice({ id, invoiceQuoteViewComponent, backButtonName, onBackButtonClick, onInvoiceDownloadError, onPaymentSuccess, shadow, className, hideDownloadButton, onInvoiceLoaded, }: InvoiceQuoteContextProps): react_jsx_runtime.JSX.Element;
25
+ type InvoiceProps = InvoiceQuoteContextProps & {
26
+ hidePaymentForm?: boolean;
27
+ };
28
+ declare function Invoice({ id, invoiceQuoteViewComponent, backButtonName, onBackButtonClick, onInvoiceDownloadError, onPaymentSuccess, shadow, className, hideDownloadButton, hidePaymentForm, onInvoiceLoaded, }: InvoiceProps): react_jsx_runtime.JSX.Element;
26
29
 
27
30
  declare global {
28
31
  interface Window {
@@ -70,7 +73,7 @@ declare function Quotes({ className, columns, filter, filterQuotes, sort, noQuot
70
73
  noQuotesMessage?: string;
71
74
  }): react_jsx_runtime.JSX.Element;
72
75
 
73
- declare const PaymentForm: ({ invoice, onFail, onPaymentSuccess, onPaymentHoldSuccess, quote, accountId, onSavePaymentMethod, onRemovePaymentMethod, onSetDefaultPaymentMethod, overrideToken, customCheckoutFunction, currencyId: currencyIdFromProps, paymentHoldOptions, }: {
76
+ declare const PaymentForm: ({ invoice, onFail, onPaymentSuccess, onPaymentHoldSuccess, quote, accountId, onSavePaymentMethod, onRemovePaymentMethod, onSetDefaultPaymentMethod, overrideToken, customCheckoutFunction, paymentHoldOptions, }: {
74
77
  invoice?: FormattedInvoice | Invoice$1 | undefined;
75
78
  quote?: Quote$1 | undefined;
76
79
  onFail: (error: any) => void;
@@ -82,7 +85,6 @@ declare const PaymentForm: ({ invoice, onFail, onPaymentSuccess, onPaymentHoldSu
82
85
  accountId?: string | undefined;
83
86
  overrideToken?: string | undefined;
84
87
  customCheckoutFunction?: ((plugin: PluginData | undefined) => Promise<any>) | undefined;
85
- currencyId?: string | undefined;
86
88
  paymentHoldOptions?: {
87
89
  payToAccept?: boolean | undefined;
88
90
  amountToHold?: number | undefined;
@@ -128,7 +130,7 @@ declare function BunnyProvider({ children, darkMode, queryClient, apiHost, token
128
130
 
129
131
  type TransactionDateType = 'createdAt' | 'issuedAt' | 'dueAt';
130
132
 
131
- declare function Transactions({ transactionComponent, showSearchBar, showTitle, title, columns, className, shadow, searchBarClassName, useModal, onTransactionClick, suppressTransactionDisplay, kindsToShow, style, filter, noTransactionsMessage, filterTransactions, sortTransactions, transactionDateType, }: {
133
+ declare function Transactions({ transactionComponent, showSearchBar, showTitle, title, columns, className, shadow, searchBarClassName, useModal, onTransactionClick, suppressTransactionDisplay, kindsToShow, style, filter, noTransactionsMessage, filterTransactions, sortTransactions, transactionDateType, hidePaymentForm, }: {
132
134
  /** A custom component to render instead of the default invoice component */
133
135
  transactionComponent?: react__default.ReactNode;
134
136
  /** Whether to show the search bar */
@@ -170,6 +172,8 @@ declare function Transactions({ transactionComponent, showSearchBar, showTitle,
170
172
  sortTransactions?: (transactionA: Transaction, transactionB: Transaction) => number;
171
173
  /** The type of date to display for transactions if applicable. Payments will always only show createdAt date. */
172
174
  transactionDateType?: TransactionDateType;
175
+ /** Whether to hide the payment form on invoices */
176
+ hidePaymentForm?: boolean;
173
177
  }): react_jsx_runtime.JSX.Element;
174
178
 
175
179
  declare const SubscriptionsWrapper: ({ handlePortalErrors, companyName, isInPreviewMode, productId, className, styles: userStyles, noSubscriptionsComponent, hideTitle, hideExpired, hideExpiredToggle, }: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bunnyapp/components",
3
- "version": "1.4.0",
3
+ "version": "1.5.0-beta.2",
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",
@@ -64,7 +64,7 @@
64
64
  },
65
65
  "peerDependencies": {
66
66
  "@ant-design/icons": "^5.6.1",
67
- "@bunnyapp/common": "1.3.0-beta.10",
67
+ "@bunnyapp/common": "1.3.0-beta.11",
68
68
  "@fortawesome/fontawesome-svg-core": "^6.7.2",
69
69
  "@fortawesome/free-brands-svg-icons": "^6.7.2",
70
70
  "@fortawesome/free-regular-svg-icons": "^6.7.2",
@@ -1,17 +0,0 @@
1
- /// <reference types="react" />
2
- import { PriceList } from '@bunnyapp/common';
3
- export type QuotePreviewData = {
4
- priceList?: PriceList;
5
- quantity?: number;
6
- editingQuoteId?: string;
7
- };
8
- export type QuotePreviewContextValues = {
9
- quotePreviewData?: QuotePreviewData;
10
- setQuotePreviewData: React.Dispatch<React.SetStateAction<QuotePreviewData | undefined>>;
11
- handleSetEditingQuote: (editingQuoteId: string) => void;
12
- };
13
- export declare const QuotePreviewContext: import("react").Context<QuotePreviewContextValues>;
14
- declare function QuotePreviewProvider({ children }: {
15
- children: React.ReactNode;
16
- }): import("react/jsx-runtime").JSX.Element;
17
- export default QuotePreviewProvider;
@@ -1,17 +0,0 @@
1
- /// <reference types="react" />
2
- import { PriceList } from '@bunnyapp/common';
3
- export type QuotePreviewData = {
4
- priceList?: PriceList;
5
- quantity?: number;
6
- editingQuoteId?: string;
7
- };
8
- export type QuotePreviewContextValues = {
9
- quotePreviewData?: QuotePreviewData;
10
- setQuotePreviewData: React.Dispatch<React.SetStateAction<QuotePreviewData | undefined>>;
11
- handleSetEditingQuote: (editingQuoteId: string) => void;
12
- };
13
- export declare const QuotePreviewContext: import("react").Context<QuotePreviewContextValues>;
14
- declare function QuotePreviewProvider({ children }: {
15
- children: React.ReactNode;
16
- }): import("react/jsx-runtime").JSX.Element;
17
- export default QuotePreviewProvider;