@bunnyapp/components 1.0.7 → 1.0.8

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 (170) hide show
  1. package/dist/cjs/index.js +730 -1052
  2. package/dist/cjs/playground/main.d.ts +1 -1
  3. package/dist/cjs/src/ajax.d.ts +1 -0
  4. package/dist/cjs/src/components/BunnyProvider.d.ts +9 -5
  5. package/dist/cjs/src/components/Checkout/Checkout.d.ts +4 -2
  6. package/dist/cjs/src/components/Checkout/InvoiceCheckout.d.ts +2 -1
  7. package/dist/cjs/src/components/Checkout/QuoteCheckout.d.ts +2 -1
  8. package/dist/cjs/src/components/FeatureUsageGraph.d.ts +1 -1
  9. package/dist/cjs/src/components/Invoice/Invoice.d.ts +2 -2
  10. package/dist/cjs/src/components/Invoice/InvoiceQuoteView.d.ts +1 -2
  11. package/dist/cjs/src/components/LegacyInvoicePDF.d.ts +2 -2
  12. package/dist/cjs/src/components/PaymentForm/DemoPay/demoPayUtils.d.ts +1 -1
  13. package/dist/cjs/src/components/PaymentForm/Finix/FinixCardForm.d.ts +1 -1
  14. package/dist/cjs/src/components/PaymentForm/FinixAch.d.ts +1 -1
  15. package/dist/cjs/src/components/PaymentForm/PaymentForm.d.ts +1 -1
  16. package/dist/cjs/src/components/PaymentForm/PaymentFormTypes.d.ts +1 -0
  17. package/dist/cjs/src/components/PaymentForm/PaymentMethod/PaymentMethod.d.ts +2 -2
  18. package/dist/cjs/src/components/PaymentForm/PaymentMethod/PaymentMethodContext.d.ts +0 -1
  19. package/dist/cjs/src/components/PaymentForm/PaymentMethodForm.d.ts +1 -1
  20. package/dist/cjs/src/components/PaymentForm/Stripe/StripeForm.d.ts +1 -1
  21. package/dist/cjs/src/components/PaymentForm/Stripe/stripeUtils.d.ts +6 -6
  22. package/dist/cjs/src/components/PaymentForm/paymentUtils.d.ts +2 -2
  23. package/dist/cjs/src/components/Quote/Quote.d.ts +2 -2
  24. package/dist/cjs/src/components/Quotes/Quotes.d.ts +2 -1
  25. package/dist/cjs/src/components/Signup/PaymentForms.d.ts +2 -2
  26. package/dist/cjs/src/components/Signup/PaymentSuccess.d.ts +4 -3
  27. package/dist/cjs/src/components/Signup/Signup.d.ts +3 -1
  28. package/dist/cjs/src/components/Subscriptions/Subscriptions.d.ts +4 -2
  29. package/dist/cjs/src/components/Subscriptions/subscriptionsList/SubscriptionsList.d.ts +1 -1
  30. package/dist/cjs/src/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionCardColumnHeaders.d.ts +1 -1
  31. package/dist/cjs/src/components/Subscriptions/subscriptionsList/subscriptionUtils.d.ts +1 -2
  32. package/dist/cjs/src/components/Transactions/Transactions.d.ts +3 -1
  33. package/dist/cjs/src/components/Transactions/TransactionsListContext.d.ts +1 -0
  34. package/dist/cjs/src/components/Transactions/transactionsList/TransactionDownload.d.ts +2 -2
  35. package/dist/cjs/src/components/Transactions/transactionsList/TransactionsListDesktop.d.ts +1 -11
  36. package/dist/cjs/src/contexts/NavigationContext.d.ts +1 -1
  37. package/dist/cjs/src/graphql/mutations/accountSignup.d.ts +2 -2
  38. package/dist/cjs/src/graphql/mutations/accountUpdate.d.ts +2 -1
  39. package/dist/cjs/src/graphql/mutations/checkout.d.ts +2 -2
  40. package/dist/cjs/src/graphql/mutations/portalSessionCreate.d.ts +2 -2
  41. package/dist/cjs/src/graphql/mutations/quoteAccountSignup.d.ts +2 -2
  42. package/dist/cjs/src/graphql/mutations/quoteAddCoupon.d.ts +2 -1
  43. package/dist/cjs/src/graphql/mutations/quoteCompose.d.ts +2 -2
  44. package/dist/cjs/src/graphql/mutations/quoteCreate.d.ts +2 -2
  45. package/dist/cjs/src/graphql/mutations/quoteRecalculateTaxes.d.ts +2 -1
  46. package/dist/cjs/src/graphql/mutations/quoteSubscriptionReinstate.d.ts +2 -2
  47. package/dist/cjs/src/graphql/queries/getAccount.d.ts +2 -2
  48. package/dist/cjs/src/graphql/queries/getBranding.d.ts +2 -2
  49. package/dist/cjs/src/graphql/queries/getCurrentUserData.d.ts +2 -2
  50. package/dist/cjs/src/graphql/queries/getFeatureUsage.d.ts +2 -1
  51. package/dist/cjs/src/graphql/queries/getFormattedQuote.d.ts +2 -2
  52. package/dist/cjs/src/graphql/queries/getInvoice.d.ts +2 -2
  53. package/dist/cjs/src/graphql/queries/getPlanChangeOptions.d.ts +2 -2
  54. package/dist/cjs/src/graphql/queries/getPriceList.d.ts +2 -2
  55. package/dist/cjs/src/graphql/queries/getQuote.d.ts +2 -2
  56. package/dist/cjs/src/graphql/queries/getQuotes.d.ts +2 -2
  57. package/dist/cjs/src/graphql/queries/getSubscription.d.ts +2 -2
  58. package/dist/cjs/src/graphql/queries/getSubscriptions.d.ts +2 -2
  59. package/dist/cjs/src/graphql/queries/getTaxationRequiredAccountFields.d.ts +6 -0
  60. package/dist/cjs/src/graphql/queries/getTransactions.d.ts +1 -1
  61. package/dist/cjs/src/hooks/quotes/useSendAcceptQuote.d.ts +7 -1
  62. package/dist/cjs/src/hooks/useHasTaxPlugin.d.ts +3 -2
  63. package/dist/cjs/src/hooks/usePaymentPlugins.d.ts +11 -0
  64. package/dist/cjs/src/hooks/usePlugins.d.ts +6 -0
  65. package/dist/cjs/src/hooks/useSigningPlugins.d.ts +5 -1
  66. package/dist/cjs/src/index.d.ts +1 -0
  67. package/dist/cjs/src/utils/GraphQLClient.d.ts +2 -0
  68. package/dist/cjs/src/utils/quoteInvoiceUtils.d.ts +6 -0
  69. package/dist/esm/index.js +722 -1043
  70. package/dist/esm/playground/main.d.ts +1 -1
  71. package/dist/esm/src/ajax.d.ts +1 -0
  72. package/dist/esm/src/components/BunnyProvider.d.ts +9 -5
  73. package/dist/esm/src/components/Checkout/Checkout.d.ts +4 -2
  74. package/dist/esm/src/components/Checkout/InvoiceCheckout.d.ts +2 -1
  75. package/dist/esm/src/components/Checkout/QuoteCheckout.d.ts +2 -1
  76. package/dist/esm/src/components/FeatureUsageGraph.d.ts +1 -1
  77. package/dist/esm/src/components/Invoice/Invoice.d.ts +2 -2
  78. package/dist/esm/src/components/Invoice/InvoiceQuoteView.d.ts +1 -2
  79. package/dist/esm/src/components/LegacyInvoicePDF.d.ts +2 -2
  80. package/dist/esm/src/components/PaymentForm/DemoPay/demoPayUtils.d.ts +1 -1
  81. package/dist/esm/src/components/PaymentForm/Finix/FinixCardForm.d.ts +1 -1
  82. package/dist/esm/src/components/PaymentForm/FinixAch.d.ts +1 -1
  83. package/dist/esm/src/components/PaymentForm/PaymentForm.d.ts +1 -1
  84. package/dist/esm/src/components/PaymentForm/PaymentFormTypes.d.ts +1 -0
  85. package/dist/esm/src/components/PaymentForm/PaymentMethod/PaymentMethod.d.ts +2 -2
  86. package/dist/esm/src/components/PaymentForm/PaymentMethod/PaymentMethodContext.d.ts +0 -1
  87. package/dist/esm/src/components/PaymentForm/PaymentMethodForm.d.ts +1 -1
  88. package/dist/esm/src/components/PaymentForm/Stripe/StripeForm.d.ts +1 -1
  89. package/dist/esm/src/components/PaymentForm/Stripe/stripeUtils.d.ts +6 -6
  90. package/dist/esm/src/components/PaymentForm/paymentUtils.d.ts +2 -2
  91. package/dist/esm/src/components/Quote/Quote.d.ts +2 -2
  92. package/dist/esm/src/components/Quotes/Quotes.d.ts +2 -1
  93. package/dist/esm/src/components/Signup/PaymentForms.d.ts +2 -2
  94. package/dist/esm/src/components/Signup/PaymentSuccess.d.ts +4 -3
  95. package/dist/esm/src/components/Signup/Signup.d.ts +3 -1
  96. package/dist/esm/src/components/Subscriptions/Subscriptions.d.ts +4 -2
  97. package/dist/esm/src/components/Subscriptions/subscriptionsList/SubscriptionsList.d.ts +1 -1
  98. package/dist/esm/src/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionCardColumnHeaders.d.ts +1 -1
  99. package/dist/esm/src/components/Subscriptions/subscriptionsList/subscriptionUtils.d.ts +1 -2
  100. package/dist/esm/src/components/Transactions/Transactions.d.ts +3 -1
  101. package/dist/esm/src/components/Transactions/TransactionsListContext.d.ts +1 -0
  102. package/dist/esm/src/components/Transactions/transactionsList/TransactionDownload.d.ts +2 -2
  103. package/dist/esm/src/components/Transactions/transactionsList/TransactionsListDesktop.d.ts +1 -11
  104. package/dist/esm/src/contexts/NavigationContext.d.ts +1 -1
  105. package/dist/esm/src/graphql/mutations/accountSignup.d.ts +2 -2
  106. package/dist/esm/src/graphql/mutations/accountUpdate.d.ts +2 -1
  107. package/dist/esm/src/graphql/mutations/checkout.d.ts +2 -2
  108. package/dist/esm/src/graphql/mutations/portalSessionCreate.d.ts +2 -2
  109. package/dist/esm/src/graphql/mutations/quoteAccountSignup.d.ts +2 -2
  110. package/dist/esm/src/graphql/mutations/quoteAddCoupon.d.ts +2 -1
  111. package/dist/esm/src/graphql/mutations/quoteCompose.d.ts +2 -2
  112. package/dist/esm/src/graphql/mutations/quoteCreate.d.ts +2 -2
  113. package/dist/esm/src/graphql/mutations/quoteRecalculateTaxes.d.ts +2 -1
  114. package/dist/esm/src/graphql/mutations/quoteSubscriptionReinstate.d.ts +2 -2
  115. package/dist/esm/src/graphql/queries/getAccount.d.ts +2 -2
  116. package/dist/esm/src/graphql/queries/getBranding.d.ts +2 -2
  117. package/dist/esm/src/graphql/queries/getCurrentUserData.d.ts +2 -2
  118. package/dist/esm/src/graphql/queries/getFeatureUsage.d.ts +2 -1
  119. package/dist/esm/src/graphql/queries/getFormattedQuote.d.ts +2 -2
  120. package/dist/esm/src/graphql/queries/getInvoice.d.ts +2 -2
  121. package/dist/esm/src/graphql/queries/getPlanChangeOptions.d.ts +2 -2
  122. package/dist/esm/src/graphql/queries/getPriceList.d.ts +2 -2
  123. package/dist/esm/src/graphql/queries/getQuote.d.ts +2 -2
  124. package/dist/esm/src/graphql/queries/getQuotes.d.ts +2 -2
  125. package/dist/esm/src/graphql/queries/getSubscription.d.ts +2 -2
  126. package/dist/esm/src/graphql/queries/getSubscriptions.d.ts +2 -2
  127. package/dist/esm/src/graphql/queries/getTaxationRequiredAccountFields.d.ts +6 -0
  128. package/dist/esm/src/graphql/queries/getTransactions.d.ts +1 -1
  129. package/dist/esm/src/hooks/quotes/useSendAcceptQuote.d.ts +7 -1
  130. package/dist/esm/src/hooks/useHasTaxPlugin.d.ts +3 -2
  131. package/dist/esm/src/hooks/usePaymentPlugins.d.ts +11 -0
  132. package/dist/esm/src/hooks/usePlugins.d.ts +6 -0
  133. package/dist/esm/src/hooks/useSigningPlugins.d.ts +5 -1
  134. package/dist/esm/src/index.d.ts +1 -0
  135. package/dist/esm/src/utils/GraphQLClient.d.ts +2 -0
  136. package/dist/esm/src/utils/quoteInvoiceUtils.d.ts +6 -0
  137. package/dist/index.d.ts +28 -14
  138. package/package.json +10 -7
  139. package/dist/cjs/src/atoms/pageContentRefAtom.d.ts +0 -1
  140. package/dist/cjs/src/atoms/planPickerQuoteDataAtom.d.ts +0 -2
  141. package/dist/cjs/src/atoms/updatingChargeQuantityIdAtom.d.ts +0 -2
  142. package/dist/cjs/src/components/Footer.d.ts +0 -4
  143. package/dist/cjs/src/components/PageContent.d.ts +0 -7
  144. package/dist/cjs/src/features/quantityChangeDrawer/QuantityChangeGridRow.d.ts +0 -11
  145. package/dist/cjs/src/features/quantityChangeDrawer/QuantityChangeGridTitle.d.ts +0 -6
  146. package/dist/cjs/src/features/quantityChangeDrawer/QuantityInput.d.ts +0 -21
  147. package/dist/cjs/src/features/quantityChangeDrawer/QuoteChangeSummarySection.d.ts +0 -9
  148. package/dist/cjs/src/features/quantityChangeDrawer/quantityChangeDrawerDesktop/QuantityChangeDrawerDesktop.d.ts +0 -14
  149. package/dist/cjs/src/graphql/QuoteRequests.d.ts +0 -6
  150. package/dist/cjs/src/graphql/SubscriptionRequests.d.ts +0 -2
  151. package/dist/cjs/src/graphql/queries/getFormattedInvoice.d.ts +0 -7
  152. package/dist/cjs/src/hooks/useCurrentUserData.d.ts +0 -2
  153. package/dist/cjs/src/hooks/useIsMobile.d.ts +0 -10
  154. package/dist/cjs/src/utils.d.ts +0 -9
  155. package/dist/esm/src/atoms/pageContentRefAtom.d.ts +0 -1
  156. package/dist/esm/src/atoms/planPickerQuoteDataAtom.d.ts +0 -2
  157. package/dist/esm/src/atoms/updatingChargeQuantityIdAtom.d.ts +0 -2
  158. package/dist/esm/src/components/Footer.d.ts +0 -4
  159. package/dist/esm/src/components/PageContent.d.ts +0 -7
  160. package/dist/esm/src/features/quantityChangeDrawer/QuantityChangeGridRow.d.ts +0 -11
  161. package/dist/esm/src/features/quantityChangeDrawer/QuantityChangeGridTitle.d.ts +0 -6
  162. package/dist/esm/src/features/quantityChangeDrawer/QuantityInput.d.ts +0 -21
  163. package/dist/esm/src/features/quantityChangeDrawer/QuoteChangeSummarySection.d.ts +0 -9
  164. package/dist/esm/src/features/quantityChangeDrawer/quantityChangeDrawerDesktop/QuantityChangeDrawerDesktop.d.ts +0 -14
  165. package/dist/esm/src/graphql/QuoteRequests.d.ts +0 -6
  166. package/dist/esm/src/graphql/SubscriptionRequests.d.ts +0 -2
  167. package/dist/esm/src/graphql/queries/getFormattedInvoice.d.ts +0 -7
  168. package/dist/esm/src/hooks/useCurrentUserData.d.ts +0 -2
  169. package/dist/esm/src/hooks/useIsMobile.d.ts +0 -10
  170. package/dist/esm/src/utils.d.ts +0 -9
@@ -1,7 +1,7 @@
1
1
  import { Quote } from "@bunnyapp/common";
2
- declare const getQuote: ({ id, token, subdomain, }: {
2
+ declare const getQuote: ({ id, token, apiHost, }: {
3
3
  id: string;
4
4
  token: string;
5
- subdomain: string;
5
+ apiHost: string;
6
6
  }) => Promise<Quote>;
7
7
  export default getQuote;
@@ -1,6 +1,6 @@
1
- declare const getQuotes: ({ token, subdomain, filter, }: {
1
+ declare const getQuotes: ({ token, apiHost, filter, }: {
2
2
  token: string;
3
- subdomain: string;
3
+ apiHost: string;
4
4
  filter?: string | undefined;
5
5
  }) => Promise<any>;
6
6
  export default getQuotes;
@@ -4,9 +4,9 @@ interface SubscriptionExtended extends Subscription {
4
4
  id?: string;
5
5
  }[];
6
6
  }
7
- declare const getSubscription: ({ token, id, subdomain, }: {
7
+ declare const getSubscription: ({ token, id, apiHost, }: {
8
8
  token: string;
9
9
  id: string;
10
- subdomain?: string | undefined;
10
+ apiHost: string;
11
11
  }) => Promise<SubscriptionExtended>;
12
12
  export default getSubscription;
@@ -1,7 +1,7 @@
1
- declare const getSubscriptions: ({ entityId, isInPreviewMode, token, subdomain, }: {
1
+ declare const getSubscriptions: ({ entityId, isInPreviewMode, token, apiHost, }: {
2
2
  entityId: string;
3
3
  isInPreviewMode?: boolean | undefined;
4
4
  token: string;
5
- subdomain: string;
5
+ apiHost: string;
6
6
  }) => Promise<any>;
7
7
  export default getSubscriptions;
@@ -0,0 +1,6 @@
1
+ import { TaxationRequiredAccountFields } from "@bunnyapp/common";
2
+ declare const getTaxationRequiredAccountFields: ({ token, apiHost, }: {
3
+ token: string;
4
+ apiHost: string;
5
+ }) => Promise<TaxationRequiredAccountFields | null>;
6
+ export default getTaxationRequiredAccountFields;
@@ -1,3 +1,3 @@
1
1
  import { TransactionKind } from "@bunnyapp/common";
2
- declare const getTransactions: (filter: string, token: string, subdomain: string, kindsToShow: TransactionKind[]) => Promise<any>;
2
+ declare const getTransactions: (filter: string, token: string, apiHost: string, kindsToShow: TransactionKind[]) => Promise<any>;
3
3
  export default getTransactions;
@@ -1,5 +1,11 @@
1
1
  /// <reference types="react" />
2
- declare const useSendAcceptQuote: (token: string, subdomain?: string, quoteId?: string) => {
2
+ declare const useSendAcceptQuote: ({ entityId, onErrorNavigate, quoteId, apiHost, token, }: {
3
+ entityId: string;
4
+ onErrorNavigate: (url: string) => void;
5
+ quoteId?: string | undefined;
6
+ apiHost: string;
7
+ token: string;
8
+ }) => {
3
9
  acceptBoxVisible: boolean;
4
10
  isAccepting: boolean;
5
11
  sendAccept: (changedFormItems: {
@@ -1,5 +1,6 @@
1
- declare const useHasTaxPlugin: ({ subdomain, token, }: {
2
- subdomain?: string | undefined;
1
+ declare const useHasTaxPlugin: ({ entityId, apiHost, token, }: {
2
+ entityId: string;
3
+ apiHost: string;
3
4
  token: string;
4
5
  }) => boolean;
5
6
  export default useHasTaxPlugin;
@@ -0,0 +1,11 @@
1
+ import { PluginData } from "@bunnyapp/common";
2
+ export declare const usePaymentPlugins: ({ entityId, apiHost, token, }: {
3
+ entityId: string;
4
+ apiHost: string;
5
+ token: string;
6
+ }) => {
7
+ paymentPlugins: PluginData[] | undefined;
8
+ paymentMethodAllowedPlugins: PluginData[] | undefined;
9
+ isFetched: boolean;
10
+ };
11
+ export default usePaymentPlugins;
@@ -0,0 +1,6 @@
1
+ declare const usePlugins: ({ entityId, apiHost, token, }: {
2
+ entityId: string;
3
+ apiHost: string;
4
+ token: string;
5
+ }) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<any, Error>;
6
+ export default usePlugins;
@@ -1,2 +1,6 @@
1
1
  import { PluginData } from "@bunnyapp/common";
2
- export declare const useSigningPlugins: (token: string, subdomain?: string) => PluginData[] | undefined;
2
+ export declare const useSigningPlugins: ({ entityId, apiHost, token, }: {
3
+ entityId: string;
4
+ apiHost: string;
5
+ token: string;
6
+ }) => PluginData[] | undefined;
@@ -1,2 +1,3 @@
1
+ import "./styles/output.css";
1
2
  export * from "./components";
2
3
  export * from "./hooks";
@@ -0,0 +1,2 @@
1
+ import { GraphQLClient } from "graphql-request";
2
+ export declare const createGraphQLClient: (token: string, apiHost: string) => GraphQLClient;
@@ -0,0 +1,6 @@
1
+ import { DOCUMENT_NAME } from "@bunnyapp/common";
2
+ export declare const quoteMetaDescription: (vendorName: string) => string;
3
+ export declare const quoteMetaTitle: ({ documentName, vendorName, }: {
4
+ documentName: DOCUMENT_NAME;
5
+ vendorName: string;
6
+ }) => string;
package/dist/index.d.ts CHANGED
@@ -1,17 +1,19 @@
1
1
  /// <reference types="react" />
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
  import { FrontendTransaction, FormattedInvoice, Quote as Quote$1, PriceList, PaymentMethod as PaymentMethod$1, TransactionKind } from '@bunnyapp/common';
4
+ import { QueryClient } from '@tanstack/react-query';
4
5
  import react from 'react';
5
6
  import * as _tanstack_react_query_build_legacy_types from '@tanstack/react-query/build/legacy/types';
6
7
  import { GraphQLClient } from 'graphql-request';
7
8
 
8
- declare function Invoice({ id, invoiceQuoteViewComponent, backButtonName, onBackButtonClick, onInvoiceDownloadError, onPaymentSuccess, }: {
9
+ declare function Invoice({ id, invoiceQuoteViewComponent, backButtonName, onBackButtonClick, onInvoiceDownloadError, onPaymentSuccess, entityId, }: {
9
10
  id?: string;
10
11
  invoiceQuoteViewComponent?: react.ReactNode;
11
12
  backButtonName?: string;
12
13
  onBackButtonClick?: () => void;
13
14
  onInvoiceDownloadError?: () => void;
14
15
  onPaymentSuccess?: (savePaymentMethod?: boolean) => void;
16
+ entityId: string;
15
17
  }): react_jsx_runtime.JSX.Element;
16
18
 
17
19
  declare global {
@@ -22,11 +24,12 @@ declare global {
22
24
  }
23
25
  }
24
26
 
25
- declare function Quote({ id }: {
27
+ declare function Quote({ entityId, id, }: {
28
+ entityId: string;
26
29
  id?: string;
27
30
  }): react_jsx_runtime.JSX.Element;
28
31
 
29
- declare function Quotes({ filter, quoteComponent, showSearchBar, showTitle, columns, className, shadow, searchBarClassName, useModal, onQuoteClick, suppressQuoteDisplay, style, noQuotesMessage, }: {
32
+ declare function Quotes({ className, columns, entityId, filter, noQuotesMessage, onQuoteClick, quoteComponent, searchBarClassName, shadow, showSearchBar, showTitle, style, suppressQuoteDisplay, useModal, }: {
30
33
  /** A custom component to render instead of the default invoice component */
31
34
  quoteComponent?: React.ReactNode;
32
35
  /** Whether to show the search bar */
@@ -53,11 +56,12 @@ declare function Quotes({ filter, quoteComponent, showSearchBar, showTitle, colu
53
56
  filter?: string;
54
57
  /** Message to display when there are no quotes */
55
58
  noQuotesMessage?: string;
59
+ entityId: string;
56
60
  }): react_jsx_runtime.JSX.Element;
57
61
 
58
- declare function PaymentMethod({ footer, processPublicUrl, }: {
62
+ declare function PaymentMethod({ entityId, footer, }: {
63
+ entityId: string;
59
64
  footer?: React.ReactNode;
60
- processPublicUrl: string;
61
65
  }): react_jsx_runtime.JSX.Element;
62
66
 
63
67
  type CheckoutProps = {
@@ -74,29 +78,35 @@ type CheckoutProps = {
74
78
  };
75
79
 
76
80
  interface CheckoutComponentProps extends CheckoutProps {
81
+ entityId: string;
77
82
  isMobile: boolean;
78
83
  token: string;
79
84
  storedPaymentMethod?: PaymentMethod$1;
85
+ quantity?: number;
80
86
  }
81
- declare const Checkout: ({ onCancel, onSuccess, onFail, invoice, open, quote, selectedPriceList, isMobile, token, storedPaymentMethod, }: CheckoutComponentProps) => react_jsx_runtime.JSX.Element | null;
87
+ declare const Checkout: ({ entityId, onCancel, onSuccess, onFail, invoice, open, quote, selectedPriceList, token, quantity, }: CheckoutComponentProps) => react_jsx_runtime.JSX.Element | null;
82
88
 
83
89
  declare const getQuoteAmountDue: (quote: Quote$1) => number;
84
90
 
85
- declare function Signup({ priceListCode, returnUrl, }: {
91
+ declare function Signup({ companyName, entityId, priceListCode, returnUrl, }: {
92
+ companyName: string;
93
+ entityId: string;
86
94
  priceListCode: string;
87
95
  returnUrl?: string;
88
96
  }): react_jsx_runtime.JSX.Element;
89
97
 
90
- declare function BunnyProvider({ children, token, subdomain, window, accountId, darkMode, }: {
98
+ declare function BunnyProvider({ accountId, children, darkMode, onErrorNavigate, queryClient, apiHost, token, window, }: {
99
+ accountId?: string;
91
100
  children: React.ReactNode;
101
+ darkMode?: boolean;
102
+ onErrorNavigate?: (url: string) => void;
103
+ queryClient?: QueryClient;
104
+ apiHost: string;
92
105
  token: string;
93
- subdomain: string;
94
106
  window: Window;
95
- accountId?: string;
96
- darkMode?: boolean;
97
107
  }): react_jsx_runtime.JSX.Element;
98
108
 
99
- declare function Transactions({ transactionComponent, showSearchBar, showTitle, columns, className, shadow, searchBarClassName, useModal, onTransactionClick, suppressTransactionDisplay, kindsToShow, style, filter, noTransactionsMessage, }: {
109
+ declare function Transactions({ transactionComponent, showSearchBar, showTitle, columns, className, shadow, searchBarClassName, useModal, onTransactionClick, suppressTransactionDisplay, kindsToShow, style, filter, noTransactionsMessage, entityId, }: {
100
110
  /** A custom component to render instead of the default invoice component */
101
111
  transactionComponent?: react.ReactNode;
102
112
  /** Whether to show the search bar */
@@ -125,11 +135,15 @@ declare function Transactions({ transactionComponent, showSearchBar, showTitle,
125
135
  filter?: string;
126
136
  /** Message to display when there are no transactions */
127
137
  noTransactionsMessage?: string;
138
+ /** The entity id to pass to the invoice component */
139
+ entityId: string;
128
140
  }): react_jsx_runtime.JSX.Element;
129
141
 
130
- declare const Subscriptions: ({ shadow, gap, showTitle, }: {
131
- shadow?: "none" | "lg" | "md" | "sm" | undefined;
142
+ declare const Subscriptions: ({ companyName, entityId, gap, shadow, showTitle, }: {
143
+ companyName: string;
144
+ entityId: string;
132
145
  gap?: number | undefined;
146
+ shadow?: "none" | "lg" | "md" | "sm" | undefined;
133
147
  showTitle?: boolean | undefined;
134
148
  }) => react_jsx_runtime.JSX.Element;
135
149
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bunnyapp/components",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
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",
@@ -9,13 +9,14 @@
9
9
  ],
10
10
  "types": "dist/index.d.ts",
11
11
  "scripts": {
12
- "test": "echo \"Error: no test specified\" && exit 1",
13
- "clean": "rimraf dist",
14
12
  "build": "npm run clean && rollup -c",
15
13
  "build-dev": "npm run clean && rollup -c -w",
16
- "storybook": "storybook dev -p 6006",
17
14
  "build-storybook": "storybook build",
18
- "vite": "vite"
15
+ "clean": "rimraf dist",
16
+ "storybook": "storybook dev -p 6006",
17
+ "test": "echo \"Error: no test specified\" && exit 1",
18
+ "vite": "vite",
19
+ "build-css": "npx @tailwindcss/cli -i ./src/styles/input.less -o ./src/styles/output.css --watch"
19
20
  },
20
21
  "keywords": [],
21
22
  "author": "Bunny",
@@ -34,6 +35,7 @@
34
35
  "@storybook/react-vite": "^8.4.7",
35
36
  "@storybook/test": "^8.4.7",
36
37
  "@tanstack/eslint-plugin-query": "^5.60.1",
38
+ "@tanstack/react-query-devtools": "^5.65.1",
37
39
  "@types/hellosign-embedded": "^2.0.6",
38
40
  "@types/lodash": "^4.17.13",
39
41
  "@types/react": "^18.3.1",
@@ -54,11 +56,11 @@
54
56
  "rollup-plugin-sourcemaps": "^0.6.3",
55
57
  "rollup-plugin-terser": "^7.0.2",
56
58
  "storybook": "^8.4.7",
59
+ "tailwindcss": "^4.0.0",
57
60
  "typescript": "^4.3.5",
58
61
  "vite": "^5.4.11"
59
62
  },
60
63
  "peerDependencies": {
61
- "@bunnyapp/common": "^1.0.33",
62
64
  "@fortawesome/fontawesome-svg-core": "^6.7.2",
63
65
  "@fortawesome/free-brands-svg-icons": "^6.7.2",
64
66
  "@fortawesome/free-regular-svg-icons": "^6.7.2",
@@ -78,7 +80,8 @@
78
80
  "react-helmet-async": "^2.0.5",
79
81
  "recharts": "^2.15.0",
80
82
  "recoil": "^0.7.7",
81
- "styled-components": "^6.1.13"
83
+ "styled-components": "^6.1.13",
84
+ "@bunnyapp/common": "^1.0.34"
82
85
  },
83
86
  "msw": {
84
87
  "workerDirectory": [
@@ -1 +0,0 @@
1
- export declare const pageContentRefState: import("recoil").RecoilState<HTMLDivElement | null>;
@@ -1,2 +0,0 @@
1
- import { QuotePreviewData } from "@bunnyapp/common";
2
- export declare const planPickerQuoteDataState: import("recoil").RecoilState<QuotePreviewData | undefined>;
@@ -1,2 +0,0 @@
1
- declare const updatingChargeQuantityIdState: import("recoil").RecoilState<string | undefined>;
2
- export default updatingChargeQuantityIdState;
@@ -1,4 +0,0 @@
1
- declare const Footer: ({ className }: {
2
- className?: string | undefined;
3
- }) => import("react/jsx-runtime").JSX.Element | null;
4
- export default Footer;
@@ -1,7 +0,0 @@
1
- import { CSSProperties, ReactNode } from "react";
2
- declare const PageContent: ({ children, className, style, }: {
3
- children: ReactNode | ReactNode[];
4
- className?: string | undefined;
5
- style?: CSSProperties | undefined;
6
- }) => import("react/jsx-runtime").JSX.Element;
7
- export default PageContent;
@@ -1,11 +0,0 @@
1
- import { Quote, Subscription, SubscriptionCharge } from "@bunnyapp/common";
2
- declare const QuantityChangeGridRow: ({ chargeIndex, editingQuote, subscriptions, subscriptionIndex, setEditingQuoteData, subscription, subscriptionCharge, }: {
3
- chargeIndex: number;
4
- editingQuote?: Quote | undefined;
5
- subscriptions: Subscription[];
6
- subscriptionIndex: number;
7
- setEditingQuoteData: (value: any) => void;
8
- subscription: Subscription;
9
- subscriptionCharge: SubscriptionCharge;
10
- }) => import("react/jsx-runtime").JSX.Element | null;
11
- export default QuantityChangeGridRow;
@@ -1,6 +0,0 @@
1
- import { ReactNode } from "react";
2
- declare const QuantityChangeGridTitle: ({ children, right, }: {
3
- children: ReactNode;
4
- right?: boolean | undefined;
5
- }) => import("react/jsx-runtime").JSX.Element;
6
- export default QuantityChangeGridTitle;
@@ -1,21 +0,0 @@
1
- import { Subscription, SubscriptionCharge, Quote } from "@bunnyapp/common";
2
- export type EditingSubscriptionType = {
3
- chargeId: string;
4
- chargeIndex: number;
5
- quantity: number;
6
- subscription: Subscription;
7
- subscriptionIndex: number;
8
- };
9
- declare const QuantityInput: ({ charge, chargeIndex, editingQuote, setEditingQuoteData, subscription, subscriptionIndex, subscriptions, }: {
10
- charge: SubscriptionCharge;
11
- chargeIndex: number;
12
- editingQuote?: Quote | undefined;
13
- setEditingQuoteData: (editingQuoteData: {
14
- id: string;
15
- isTrial: boolean;
16
- } | undefined) => void;
17
- subscription: Subscription;
18
- subscriptionIndex: number;
19
- subscriptions: Subscription[];
20
- }) => import("react/jsx-runtime").JSX.Element;
21
- export default QuantityInput;
@@ -1,9 +0,0 @@
1
- import { Quote } from "@bunnyapp/common";
2
- import { EditingQuoteDataType } from "../../components/Subscriptions/Subscriptions";
3
- declare const QuoteChangeSummarySection: ({ editingQuote, editingQuoteData, openCheckout, setEditingQuoteData, }: {
4
- editingQuote?: Quote | undefined;
5
- editingQuoteData?: EditingQuoteDataType | undefined;
6
- openCheckout: () => void;
7
- setEditingQuoteData: (editingQuoteData: EditingQuoteDataType | undefined) => void;
8
- }) => import("react/jsx-runtime").JSX.Element;
9
- export default QuoteChangeSummarySection;
@@ -1,14 +0,0 @@
1
- import { Subscription, Quote } from "@bunnyapp/common";
2
- import { EditingQuoteDataType } from "../../../components/Subscriptions/Subscriptions";
3
- export declare const QUANTITY_CHANGE_HEADER_TITLE = "Update unit quantity";
4
- export declare const QUANTITY_CHANGE_HEADER_DESCRIPTION = "Adjust quantities below. The change will take effect immediately after checkout has been completed.";
5
- declare const QuantityChangeDrawerDesktop: ({ editingQuote, editingQuoteData, onClose, open, openCheckout, setEditingQuoteData, subscriptions, }: {
6
- editingQuote?: Quote | undefined;
7
- editingQuoteData?: EditingQuoteDataType | undefined;
8
- onClose: () => void;
9
- open: boolean;
10
- openCheckout: () => void;
11
- setEditingQuoteData: (value: EditingQuoteDataType | undefined) => void;
12
- subscriptions: Subscription[];
13
- }) => import("react/jsx-runtime").JSX.Element | null;
14
- export default QuantityChangeDrawerDesktop;
@@ -1,6 +0,0 @@
1
- export declare const useCreateSubscriptionQuote: () => (subscriptionIds: string[], token: string) => Promise<unknown>;
2
- export declare const useQuoteChangeUpdate: () => (charges: {
3
- id: string;
4
- quantity: number;
5
- }[], quoteChangeId: string, token: string) => Promise<unknown>;
6
- export declare const useQuoteDelete: () => (quoteId: string, token: string) => Promise<unknown>;
@@ -1,2 +0,0 @@
1
- export declare const useCancelSubscription: () => (subscriptionIds: string[], token: string) => Promise<any>;
2
- export declare const useSubscriptionTrialConvert: () => (subscriptionId: string, token: string, paymentId?: string) => Promise<any>;
@@ -1,7 +0,0 @@
1
- import { FormattedInvoice } from "@bunnyapp/common";
2
- declare const getFormattedInvoice: ({ id, token, subdomain, }: {
3
- id?: string | undefined;
4
- subdomain?: string | undefined;
5
- token: string;
6
- }) => Promise<FormattedInvoice>;
7
- export default getFormattedInvoice;
@@ -1,2 +0,0 @@
1
- declare const useCurrentUserData: () => any;
2
- export default useCurrentUserData;
@@ -1,10 +0,0 @@
1
- export declare enum BreakpointNumbers {
2
- xs = 480,
3
- sm = 768,
4
- md = 992,
5
- lg = 1200,
6
- xl = 1400,
7
- xxl = 2000
8
- }
9
- export declare const breakpointList: BreakpointNumbers[];
10
- export declare const useIsMobile: (window: Window) => boolean;
@@ -1,9 +0,0 @@
1
- export declare function capitalizeFirstLetter(string: string): string;
2
- export declare const WARREN_STATE_LS_KEY = "warrenState";
3
- export declare const CURRENT_WARREN_ID_LS_KEY = "currentWarrenId";
4
- export declare const ERROR_MESSAGE_NO_SUBDOMAIN_DEFINED = "No subdomain defined in local storage";
5
- export declare const getIsCapacitorApp: () => boolean;
6
- export declare const getApiBase: (subdomain?: string) => string;
7
- export declare const getGraphQLBase: () => string;
8
- export declare const createRequestHeaders: (token: string) => Record<string, any>;
9
- export declare const useGraphQLRequest: () => (query: string, token: string, variables?: any) => Promise<unknown>;
@@ -1 +0,0 @@
1
- export declare const pageContentRefState: import("recoil").RecoilState<HTMLDivElement | null>;
@@ -1,2 +0,0 @@
1
- import { QuotePreviewData } from "@bunnyapp/common";
2
- export declare const planPickerQuoteDataState: import("recoil").RecoilState<QuotePreviewData | undefined>;
@@ -1,2 +0,0 @@
1
- declare const updatingChargeQuantityIdState: import("recoil").RecoilState<string | undefined>;
2
- export default updatingChargeQuantityIdState;
@@ -1,4 +0,0 @@
1
- declare const Footer: ({ className }: {
2
- className?: string | undefined;
3
- }) => import("react/jsx-runtime").JSX.Element | null;
4
- export default Footer;
@@ -1,7 +0,0 @@
1
- import { CSSProperties, ReactNode } from "react";
2
- declare const PageContent: ({ children, className, style, }: {
3
- children: ReactNode | ReactNode[];
4
- className?: string | undefined;
5
- style?: CSSProperties | undefined;
6
- }) => import("react/jsx-runtime").JSX.Element;
7
- export default PageContent;
@@ -1,11 +0,0 @@
1
- import { Quote, Subscription, SubscriptionCharge } from "@bunnyapp/common";
2
- declare const QuantityChangeGridRow: ({ chargeIndex, editingQuote, subscriptions, subscriptionIndex, setEditingQuoteData, subscription, subscriptionCharge, }: {
3
- chargeIndex: number;
4
- editingQuote?: Quote | undefined;
5
- subscriptions: Subscription[];
6
- subscriptionIndex: number;
7
- setEditingQuoteData: (value: any) => void;
8
- subscription: Subscription;
9
- subscriptionCharge: SubscriptionCharge;
10
- }) => import("react/jsx-runtime").JSX.Element | null;
11
- export default QuantityChangeGridRow;
@@ -1,6 +0,0 @@
1
- import { ReactNode } from "react";
2
- declare const QuantityChangeGridTitle: ({ children, right, }: {
3
- children: ReactNode;
4
- right?: boolean | undefined;
5
- }) => import("react/jsx-runtime").JSX.Element;
6
- export default QuantityChangeGridTitle;
@@ -1,21 +0,0 @@
1
- import { Subscription, SubscriptionCharge, Quote } from "@bunnyapp/common";
2
- export type EditingSubscriptionType = {
3
- chargeId: string;
4
- chargeIndex: number;
5
- quantity: number;
6
- subscription: Subscription;
7
- subscriptionIndex: number;
8
- };
9
- declare const QuantityInput: ({ charge, chargeIndex, editingQuote, setEditingQuoteData, subscription, subscriptionIndex, subscriptions, }: {
10
- charge: SubscriptionCharge;
11
- chargeIndex: number;
12
- editingQuote?: Quote | undefined;
13
- setEditingQuoteData: (editingQuoteData: {
14
- id: string;
15
- isTrial: boolean;
16
- } | undefined) => void;
17
- subscription: Subscription;
18
- subscriptionIndex: number;
19
- subscriptions: Subscription[];
20
- }) => import("react/jsx-runtime").JSX.Element;
21
- export default QuantityInput;
@@ -1,9 +0,0 @@
1
- import { Quote } from "@bunnyapp/common";
2
- import { EditingQuoteDataType } from "../../components/Subscriptions/Subscriptions";
3
- declare const QuoteChangeSummarySection: ({ editingQuote, editingQuoteData, openCheckout, setEditingQuoteData, }: {
4
- editingQuote?: Quote | undefined;
5
- editingQuoteData?: EditingQuoteDataType | undefined;
6
- openCheckout: () => void;
7
- setEditingQuoteData: (editingQuoteData: EditingQuoteDataType | undefined) => void;
8
- }) => import("react/jsx-runtime").JSX.Element;
9
- export default QuoteChangeSummarySection;
@@ -1,14 +0,0 @@
1
- import { Subscription, Quote } from "@bunnyapp/common";
2
- import { EditingQuoteDataType } from "../../../components/Subscriptions/Subscriptions";
3
- export declare const QUANTITY_CHANGE_HEADER_TITLE = "Update unit quantity";
4
- export declare const QUANTITY_CHANGE_HEADER_DESCRIPTION = "Adjust quantities below. The change will take effect immediately after checkout has been completed.";
5
- declare const QuantityChangeDrawerDesktop: ({ editingQuote, editingQuoteData, onClose, open, openCheckout, setEditingQuoteData, subscriptions, }: {
6
- editingQuote?: Quote | undefined;
7
- editingQuoteData?: EditingQuoteDataType | undefined;
8
- onClose: () => void;
9
- open: boolean;
10
- openCheckout: () => void;
11
- setEditingQuoteData: (value: EditingQuoteDataType | undefined) => void;
12
- subscriptions: Subscription[];
13
- }) => import("react/jsx-runtime").JSX.Element | null;
14
- export default QuantityChangeDrawerDesktop;
@@ -1,6 +0,0 @@
1
- export declare const useCreateSubscriptionQuote: () => (subscriptionIds: string[], token: string) => Promise<unknown>;
2
- export declare const useQuoteChangeUpdate: () => (charges: {
3
- id: string;
4
- quantity: number;
5
- }[], quoteChangeId: string, token: string) => Promise<unknown>;
6
- export declare const useQuoteDelete: () => (quoteId: string, token: string) => Promise<unknown>;
@@ -1,2 +0,0 @@
1
- export declare const useCancelSubscription: () => (subscriptionIds: string[], token: string) => Promise<any>;
2
- export declare const useSubscriptionTrialConvert: () => (subscriptionId: string, token: string, paymentId?: string) => Promise<any>;
@@ -1,7 +0,0 @@
1
- import { FormattedInvoice } from "@bunnyapp/common";
2
- declare const getFormattedInvoice: ({ id, token, subdomain, }: {
3
- id?: string | undefined;
4
- subdomain?: string | undefined;
5
- token: string;
6
- }) => Promise<FormattedInvoice>;
7
- export default getFormattedInvoice;
@@ -1,2 +0,0 @@
1
- declare const useCurrentUserData: () => any;
2
- export default useCurrentUserData;
@@ -1,10 +0,0 @@
1
- export declare enum BreakpointNumbers {
2
- xs = 480,
3
- sm = 768,
4
- md = 992,
5
- lg = 1200,
6
- xl = 1400,
7
- xxl = 2000
8
- }
9
- export declare const breakpointList: BreakpointNumbers[];
10
- export declare const useIsMobile: (window: Window) => boolean;
@@ -1,9 +0,0 @@
1
- export declare function capitalizeFirstLetter(string: string): string;
2
- export declare const WARREN_STATE_LS_KEY = "warrenState";
3
- export declare const CURRENT_WARREN_ID_LS_KEY = "currentWarrenId";
4
- export declare const ERROR_MESSAGE_NO_SUBDOMAIN_DEFINED = "No subdomain defined in local storage";
5
- export declare const getIsCapacitorApp: () => boolean;
6
- export declare const getApiBase: (subdomain?: string) => string;
7
- export declare const getGraphQLBase: () => string;
8
- export declare const createRequestHeaders: (token: string) => Record<string, any>;
9
- export declare const useGraphQLRequest: () => (query: string, token: string, variables?: any) => Promise<unknown>;