@bunnyapp/components 1.0.35 → 1.0.37

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 (191) hide show
  1. package/README.md +59 -20
  2. package/dist/cjs/index.js +20857 -0
  3. package/dist/cjs/playground/billingdetails/index.d.ts +1 -0
  4. package/dist/cjs/playground/main.d.ts +1 -0
  5. package/dist/cjs/playground/transactions/index.d.ts +1 -0
  6. package/dist/cjs/src/ajax.d.ts +1 -0
  7. package/dist/cjs/src/components/BillingDetails/BillingDetails.d.ts +15 -0
  8. package/dist/cjs/src/components/BillingDetails/BillingDetails.stories.d.ts +14 -0
  9. package/dist/cjs/src/components/BillingDetails/BillingDetailsForm.d.ts +9 -0
  10. package/dist/cjs/src/components/BillingDetails/index.d.ts +1 -0
  11. package/dist/cjs/src/components/BunnyProvider.d.ts +23 -0
  12. package/dist/cjs/src/components/Card.d.ts +7 -0
  13. package/dist/cjs/src/components/Checkout/Checkout.d.ts +11 -0
  14. package/dist/cjs/src/components/Checkout/CouponComponent.d.ts +7 -0
  15. package/dist/cjs/src/components/Checkout/QuoteCheckout.d.ts +12 -0
  16. package/dist/cjs/src/components/Checkout/checkoutUtils.d.ts +2 -0
  17. package/dist/cjs/src/components/Checkout/index.d.ts +2 -0
  18. package/dist/cjs/src/components/DrawerHeader.d.ts +7 -0
  19. package/dist/cjs/src/components/Error.d.ts +5 -0
  20. package/dist/cjs/src/components/FeatureUsageGraph.d.ts +6 -0
  21. package/dist/cjs/src/components/HeaderModalWrapper.d.ts +2 -0
  22. package/dist/cjs/src/components/Invoice/Invoice.d.ts +3 -0
  23. package/dist/cjs/src/components/Invoice/Invoice.stories.d.ts +18 -0
  24. package/dist/cjs/src/components/Invoice/InvoiceQuoteContext.d.ts +18 -0
  25. package/dist/cjs/src/components/Invoice/InvoiceQuoteView.d.ts +11 -0
  26. package/dist/cjs/src/components/Invoice/index.d.ts +8 -0
  27. package/dist/cjs/src/components/LegacyInvoicePDF.d.ts +5 -0
  28. package/dist/cjs/src/components/PageWrapper.d.ts +1 -0
  29. package/dist/cjs/src/components/PandadocPollingModal.d.ts +7 -0
  30. package/dist/cjs/src/components/PaymentForm/CheckoutFooter.d.ts +9 -0
  31. package/dist/cjs/src/components/PaymentForm/DemoPay/DemoPayCardCvc.d.ts +7 -0
  32. package/dist/cjs/src/components/PaymentForm/DemoPay/DemoPayCardNumber.d.ts +7 -0
  33. package/dist/cjs/src/components/PaymentForm/DemoPay/DemoPayExpiry.d.ts +7 -0
  34. package/dist/cjs/src/components/PaymentForm/DemoPay/DemoPayForm.d.ts +7 -0
  35. package/dist/cjs/src/components/PaymentForm/DemoPay/demoPayUtils.d.ts +21 -0
  36. package/dist/cjs/src/components/PaymentForm/DemoPay/hooks/usePay.d.ts +12 -0
  37. package/dist/cjs/src/components/PaymentForm/DemoPay/hooks/useSave.d.ts +21 -0
  38. package/dist/cjs/src/components/PaymentForm/DemoPay/index.d.ts +1 -0
  39. package/dist/cjs/src/components/PaymentForm/PaymentForm.d.ts +17 -0
  40. package/dist/cjs/src/components/PaymentForm/PaymentFormTypes.d.ts +24 -0
  41. package/dist/cjs/src/components/PaymentForm/PaymentMethod/CreditCard/CreditCard.d.ts +22 -0
  42. package/dist/cjs/src/components/PaymentForm/PaymentMethod/CreditCard/LargCardIcon.d.ts +2 -0
  43. package/dist/cjs/src/components/PaymentForm/PaymentMethod/CreditCard/PlusIcon.d.ts +4 -0
  44. package/dist/cjs/src/components/PaymentForm/PaymentMethod/PaymentMethod.d.ts +9 -0
  45. package/dist/cjs/src/components/PaymentForm/PaymentMethod/PaymentMethod.stories.d.ts +11 -0
  46. package/dist/cjs/src/components/PaymentForm/PaymentMethod/index.d.ts +1 -0
  47. package/dist/cjs/src/components/PaymentForm/PaymentMethodDetails.d.ts +9 -0
  48. package/dist/cjs/src/components/PaymentForm/PaymentMethodSelector.d.ts +7 -0
  49. package/dist/cjs/src/components/PaymentForm/SavePaymentMethodFooter.d.ts +6 -0
  50. package/dist/cjs/src/components/PaymentForm/Stripe/PaymentMethodForm.d.ts +7 -0
  51. package/dist/cjs/src/components/PaymentForm/Stripe/StripeForm.d.ts +7 -0
  52. package/dist/cjs/src/components/PaymentForm/Stripe/hooks/usePay.d.ts +12 -0
  53. package/dist/cjs/src/components/PaymentForm/Stripe/hooks/useSave.d.ts +10 -0
  54. package/dist/cjs/src/components/PaymentForm/Stripe/stripeUtils.d.ts +26 -0
  55. package/dist/cjs/src/components/PaymentForm/index.d.ts +2 -0
  56. package/dist/cjs/src/components/PaymentForm/useRemovePaymentMethod.d.ts +3 -0
  57. package/dist/cjs/src/components/Quote/AcceptQuoteModal.d.ts +9 -0
  58. package/dist/cjs/src/components/Quote/Quote.d.ts +3 -0
  59. package/dist/cjs/src/components/Quote/Quote.stories.d.ts +144 -0
  60. package/dist/cjs/src/components/Quote/StyledModal.d.ts +3 -0
  61. package/dist/cjs/src/components/Quote/index.d.ts +1 -0
  62. package/dist/cjs/src/components/Quotes/Quotes.d.ts +40 -0
  63. package/dist/cjs/src/components/Quotes/Quotes.stories.d.ts +22 -0
  64. package/dist/cjs/src/components/Quotes/index.d.ts +1 -0
  65. package/dist/cjs/src/components/Signup/PaymentForms.d.ts +18 -0
  66. package/dist/cjs/src/components/Signup/PaymentSuccess.d.ts +9 -0
  67. package/dist/cjs/src/components/Signup/PriceListDisplay.d.ts +6 -0
  68. package/dist/cjs/src/components/Signup/Signup.d.ts +21 -0
  69. package/dist/cjs/src/components/Signup/Signup.stories.d.ts +10 -0
  70. package/dist/cjs/src/components/Signup/index.d.ts +1 -0
  71. package/dist/cjs/src/components/StateTag.d.ts +4 -0
  72. package/dist/cjs/src/components/Subscriptions/Subscriptions.d.ts +23 -0
  73. package/dist/cjs/src/components/Subscriptions/Subscriptions.stories.d.ts +10 -0
  74. package/dist/cjs/src/components/Subscriptions/SubscriptionsContext.d.ts +8 -0
  75. package/dist/cjs/src/components/Subscriptions/index.d.ts +1 -0
  76. package/dist/cjs/src/components/Subscriptions/subscriptionsList/SubscriptionCardActions.d.ts +8 -0
  77. package/dist/cjs/src/components/Subscriptions/subscriptionsList/SubscriptionCardHeader.d.ts +8 -0
  78. package/dist/cjs/src/components/Subscriptions/subscriptionsList/SubscriptionChargeTotal.d.ts +6 -0
  79. package/dist/cjs/src/components/Subscriptions/subscriptionsList/SubscriptionChargeUnitPrice.d.ts +6 -0
  80. package/dist/cjs/src/components/Subscriptions/subscriptionsList/SubscriptionsList.d.ts +9 -0
  81. package/dist/cjs/src/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionCardColumnHeaders.d.ts +12 -0
  82. package/dist/cjs/src/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionCardDesktop.d.ts +8 -0
  83. package/dist/cjs/src/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionsCardCell.d.ts +9 -0
  84. package/dist/cjs/src/components/Subscriptions/subscriptionsList/subscriptionCardMobile/SubscriptionCardCellMobile.d.ts +8 -0
  85. package/dist/cjs/src/components/Subscriptions/subscriptionsList/subscriptionCardMobile/SubscriptionCardMobile.d.ts +5 -0
  86. package/dist/cjs/src/components/Subscriptions/subscriptionsList/subscriptionUtils.d.ts +16 -0
  87. package/dist/cjs/src/components/TaxationForm.d.ts +6 -0
  88. package/dist/cjs/src/components/Transactions/Transactions.d.ts +55 -0
  89. package/dist/cjs/src/components/Transactions/Transactions.stories.d.ts +26 -0
  90. package/dist/cjs/src/components/Transactions/TransactionsListContext.d.ts +30 -0
  91. package/dist/cjs/src/components/Transactions/index.d.ts +1 -0
  92. package/dist/cjs/src/components/Transactions/transactionsList/TransactionDate.d.ts +4 -0
  93. package/dist/cjs/src/components/Transactions/transactionsList/TransactionDownload.d.ts +7 -0
  94. package/dist/cjs/src/components/Transactions/transactionsList/TransactionGridCell.d.ts +2 -0
  95. package/dist/cjs/src/components/Transactions/transactionsList/TransactionTitle.d.ts +5 -0
  96. package/dist/cjs/src/components/Transactions/transactionsList/TransactionsEmptyState.d.ts +2 -0
  97. package/dist/cjs/src/components/Transactions/transactionsList/TransactionsListDesktop.d.ts +7 -0
  98. package/dist/cjs/src/components/Transactions/transactionsList/TransactionsListMobile.d.ts +6 -0
  99. package/dist/cjs/src/components/Transactions/transactionsList/utils.d.ts +3 -0
  100. package/dist/cjs/src/components/icons/ArrowDownToLine.d.ts +5 -0
  101. package/dist/cjs/src/components/icons/CardIcon.d.ts +2 -0
  102. package/dist/cjs/src/components/index.d.ts +10 -0
  103. package/dist/cjs/src/contexts/BrandContext.d.ts +7 -0
  104. package/dist/cjs/src/contexts/NavigationContext.d.ts +9 -0
  105. package/dist/cjs/src/contexts/PaymentContext.d.ts +10 -0
  106. package/dist/cjs/src/enums/SubscriptionState.d.ts +8 -0
  107. package/dist/cjs/src/graphql/mutations/accountSignup.d.ts +12 -0
  108. package/dist/cjs/src/graphql/mutations/accountUpdate.d.ts +7 -0
  109. package/dist/cjs/src/graphql/mutations/billingDetailsUpdate.d.ts +6 -0
  110. package/dist/cjs/src/graphql/mutations/checkout.d.ts +23 -0
  111. package/dist/cjs/src/graphql/mutations/quoteAccountSignup.d.ts +14 -0
  112. package/dist/cjs/src/graphql/mutations/quoteAddCoupon.d.ts +8 -0
  113. package/dist/cjs/src/graphql/mutations/quoteCompose.d.ts +13 -0
  114. package/dist/cjs/src/graphql/mutations/quoteRecalculateTaxes.d.ts +6 -0
  115. package/dist/cjs/src/graphql/mutations/quoteSubscriptionReinstate.d.ts +7 -0
  116. package/dist/cjs/src/graphql/queries/getBillingDetails.d.ts +6 -0
  117. package/dist/cjs/src/graphql/queries/getBranding.d.ts +6 -0
  118. package/dist/cjs/src/graphql/queries/getFeatureUsage.d.ts +10 -0
  119. package/dist/cjs/src/graphql/queries/getFormattedQuote.d.ts +7 -0
  120. package/dist/cjs/src/graphql/queries/getPlanChangeOptions.d.ts +8 -0
  121. package/dist/cjs/src/graphql/queries/getPriceList.d.ts +7 -0
  122. package/dist/cjs/src/graphql/queries/getQuotes.d.ts +6 -0
  123. package/dist/cjs/src/graphql/queries/getSubscriptions.d.ts +7 -0
  124. package/dist/cjs/src/graphql/queries/getTaxationRequiredAccountFields.d.ts +6 -0
  125. package/dist/cjs/src/graphql/queries/getTransactions.d.ts +3 -0
  126. package/dist/cjs/src/hooks/index.d.ts +1 -0
  127. package/dist/cjs/src/hooks/quotes/useSendAcceptQuote.d.ts +20 -0
  128. package/dist/cjs/src/hooks/quotes/useSigningComplete.d.ts +5 -0
  129. package/dist/cjs/src/hooks/subscriptions/useSubscriptions.d.ts +5 -0
  130. package/dist/cjs/src/hooks/useFocusFirstInput.d.ts +7 -0
  131. package/dist/cjs/src/hooks/useHasTaxPlugin.d.ts +6 -0
  132. package/dist/cjs/src/hooks/useIsExpired.d.ts +2 -0
  133. package/dist/cjs/src/hooks/usePaymentMethod.d.ts +5 -0
  134. package/dist/cjs/src/hooks/usePaymentPlugins.d.ts +11 -0
  135. package/dist/cjs/src/hooks/usePlugins.d.ts +6 -0
  136. package/dist/cjs/src/hooks/useSigningPlugins.d.ts +6 -0
  137. package/dist/cjs/src/hooks/useToken.d.ts +2 -0
  138. package/dist/cjs/src/index.d.ts +3 -0
  139. package/dist/cjs/src/mocks/browser.d.ts +1 -0
  140. package/dist/cjs/src/mocks/handlers.d.ts +1 -0
  141. package/dist/cjs/src/storybook-utils.d.ts +10 -0
  142. package/dist/cjs/src/types/billingDetails.d.ts +14 -0
  143. package/dist/cjs/src/types/shadowType.d.ts +1 -0
  144. package/dist/cjs/src/utils/GraphQLClient.d.ts +2 -0
  145. package/dist/cjs/src/utils/quoteInvoiceUtils.d.ts +6 -0
  146. package/dist/cjs/src/utils/styled.d.ts +3 -0
  147. package/dist/cjs/vite.config.d.ts +2 -0
  148. package/dist/esm/index.js +218 -215
  149. package/dist/esm/src/ajax.d.ts +1 -1
  150. package/dist/esm/src/components/BillingDetails/BillingDetails.d.ts +2 -1
  151. package/dist/esm/src/components/BillingDetails/BillingDetails.stories.d.ts +3 -0
  152. package/dist/esm/src/components/BillingDetails/BillingDetailsForm.d.ts +9 -0
  153. package/dist/esm/src/components/BunnyProvider.d.ts +2 -2
  154. package/dist/esm/src/components/DrawerHeader.d.ts +3 -2
  155. package/dist/esm/src/components/LegacyInvoicePDF.d.ts +1 -1
  156. package/dist/esm/src/components/PaymentForm/DemoPay/demoPayUtils.d.ts +1 -1
  157. package/dist/esm/src/components/PaymentForm/DemoPay/hooks/useSave.d.ts +1 -1
  158. package/dist/esm/src/components/PaymentForm/PaymentForm.d.ts +3 -1
  159. package/dist/esm/src/components/PaymentForm/PaymentMethod/PaymentMethod.d.ts +2 -1
  160. package/dist/esm/src/components/PaymentForm/PaymentMethodDetails.d.ts +3 -1
  161. package/dist/esm/src/components/PaymentForm/Stripe/stripeUtils.d.ts +3 -3
  162. package/dist/esm/src/components/PaymentForm/index.d.ts +1 -0
  163. package/dist/esm/src/components/PaymentForm/useRemovePaymentMethod.d.ts +1 -1
  164. package/dist/esm/src/components/Transactions/Transactions.d.ts +2 -1
  165. package/dist/esm/src/components/Transactions/transactionsList/TransactionDownload.d.ts +1 -1
  166. package/dist/esm/src/components/Transactions/transactionsList/TransactionsListDesktop.d.ts +1 -1
  167. package/dist/esm/src/components/index.d.ts +1 -1
  168. package/dist/esm/src/graphql/mutations/accountUpdate.d.ts +1 -1
  169. package/dist/esm/src/graphql/mutations/billingDetailsUpdate.d.ts +1 -1
  170. package/dist/esm/src/graphql/mutations/checkout.d.ts +1 -1
  171. package/dist/esm/src/graphql/mutations/quoteAccountSignup.d.ts +1 -1
  172. package/dist/esm/src/graphql/mutations/quoteAddCoupon.d.ts +1 -1
  173. package/dist/esm/src/graphql/queries/getBillingDetails.d.ts +1 -1
  174. package/dist/esm/src/graphql/queries/getBranding.d.ts +1 -1
  175. package/dist/esm/src/graphql/queries/getFeatureUsage.d.ts +1 -1
  176. package/dist/esm/src/graphql/queries/getFormattedQuote.d.ts +1 -1
  177. package/dist/esm/src/graphql/queries/getPlanChangeOptions.d.ts +1 -1
  178. package/dist/esm/src/graphql/queries/getPriceList.d.ts +1 -1
  179. package/dist/esm/src/graphql/queries/getQuotes.d.ts +1 -1
  180. package/dist/esm/src/graphql/queries/getSubscriptions.d.ts +1 -1
  181. package/dist/esm/src/graphql/queries/getTransactions.d.ts +1 -1
  182. package/dist/esm/src/hooks/quotes/useSendAcceptQuote.d.ts +1 -1
  183. package/dist/esm/src/hooks/quotes/useSigningComplete.d.ts +1 -1
  184. package/dist/esm/src/hooks/usePaymentMethod.d.ts +4 -1
  185. package/dist/esm/src/hooks/usePaymentPlugins.d.ts +1 -1
  186. package/dist/esm/src/hooks/usePlugins.d.ts +1 -1
  187. package/dist/esm/src/hooks/useSigningPlugins.d.ts +1 -1
  188. package/dist/esm/src/hooks/useToken.d.ts +1 -1
  189. package/dist/esm/src/utils/GraphQLClient.d.ts +1 -1
  190. package/dist/index.d.ts +30 -11
  191. package/package.json +2 -3
@@ -1 +1 @@
1
- export declare const useDownloadFile: (id?: string, onError?: ((error: any) => void) | undefined) => (url: string, token: string) => Promise<any>;
1
+ export declare const useDownloadFile: (id?: string, onError?: ((error: any) => void) | undefined) => (url: string, token?: string) => Promise<any>;
@@ -1,11 +1,12 @@
1
1
  import "../../styles/index.less";
2
2
  import { ShadowType } from "../../types/shadowType";
3
- declare const BillingDetails: ({ entityId, isCardEnabled, shadow, className, hidePaymentMethodForm, countryListFilter, }: {
3
+ declare const BillingDetails: ({ entityId, isCardEnabled, shadow, className, hidePaymentMethodForm, hideBillingDetailsForm, countryListFilter, }: {
4
4
  entityId: string;
5
5
  isCardEnabled?: boolean | undefined;
6
6
  shadow?: ShadowType | undefined;
7
7
  className?: string | undefined;
8
8
  hidePaymentMethodForm?: boolean | undefined;
9
+ hideBillingDetailsForm?: boolean | undefined;
9
10
  countryListFilter?: ((country: {
10
11
  value: string;
11
12
  label: string;
@@ -9,3 +9,6 @@ export declare const CustomClassName: Story;
9
9
  export declare const NoCard: Story;
10
10
  export declare const Mobile: Story;
11
11
  export declare const DarkMode: Story;
12
+ export declare const HidePaymentMethodForm: Story;
13
+ export declare const HideBillingDetailsForm: Story;
14
+ export declare const HideBothForms: Story;
@@ -0,0 +1,9 @@
1
+ import "../../styles/index.less";
2
+ export default function BillingDetailsSection({ entityId, hidePaymentMethodForm, countryListFilter, }: {
3
+ entityId: string;
4
+ hidePaymentMethodForm: boolean;
5
+ countryListFilter?: (country: {
6
+ value: string;
7
+ label: string;
8
+ }) => boolean;
9
+ }): import("react/jsx-runtime").JSX.Element;
@@ -5,7 +5,7 @@ import { GraphQLClient } from "graphql-request";
5
5
  export type BunnyContextValues = {
6
6
  apiHost: string;
7
7
  graphQLClient: GraphQLClient;
8
- token: string;
8
+ token?: string;
9
9
  displayPayButtonNameAnyways?: boolean;
10
10
  darkMode?: boolean;
11
11
  onTokenExpired?: () => void;
@@ -16,7 +16,7 @@ declare function BunnyProvider({ children, darkMode, queryClient, apiHost, token
16
16
  darkMode?: boolean;
17
17
  queryClient?: QueryClient;
18
18
  apiHost: string;
19
- token: string;
19
+ token?: string;
20
20
  onTokenExpired?: () => void;
21
21
  configProviderProps?: ThemeConfig | undefined;
22
22
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,7 @@
1
- declare const DrawerHeader: ({ description, onClose, title, }: {
1
+ declare const DrawerHeader: ({ description, onClose, title, closeButtonClassName, }: {
2
2
  description?: string | undefined;
3
- onClose: () => void;
3
+ onClose?: (() => void) | undefined;
4
4
  title: string;
5
+ closeButtonClassName?: string | undefined;
5
6
  }) => import("react/jsx-runtime").JSX.Element;
6
7
  export default DrawerHeader;
@@ -1,5 +1,5 @@
1
1
  export default function InvoicePDF({ invoiceUuid, apiHost, token, }: {
2
2
  invoiceUuid?: string;
3
3
  apiHost: string;
4
- token: string;
4
+ token?: string;
5
5
  }): import("react/jsx-runtime").JSX.Element;
@@ -17,5 +17,5 @@ export declare const storePayment: (options: {
17
17
  testCreditCardCvc: string;
18
18
  testCreditCardExpirationDate: string;
19
19
  testCreditCardNumber: string;
20
- token: string;
20
+ token?: string | undefined;
21
21
  }, plugin: PluginData, apiHost: string, accountId?: string) => Promise<any>;
@@ -3,7 +3,7 @@ export declare function useSave({ onSaveSuccess, token, apiHost, accountId, }: {
3
3
  onSaveSuccess: (response: any) => void;
4
4
  quote?: Quote;
5
5
  invoice?: FormattedInvoice;
6
- token: string;
6
+ token?: string;
7
7
  apiHost: string;
8
8
  accountId?: string;
9
9
  }): {
@@ -1,6 +1,7 @@
1
+ /// <reference types="react" />
1
2
  import { FormattedInvoice, PluginData, Quote } from "@bunnyapp/common";
2
3
  import { GraphQLClient } from "graphql-request";
3
- export declare const PaymentForm: ({ entityId, invoice, onFail, onPaymentSuccess, quote, accountId, onSavePaymentMethod, overrideToken, graphQLClient, customCheckoutFunction, currencyId: currencyIdFromProps, }: {
4
+ export declare const PaymentForm: ({ entityId, invoice, onFail, onPaymentSuccess, quote, accountId, onSavePaymentMethod, overrideToken, graphQLClient, customCheckoutFunction, currencyId: currencyIdFromProps, customPaymentForms, }: {
4
5
  entityId: string;
5
6
  invoice?: FormattedInvoice | undefined;
6
7
  quote?: Quote | undefined;
@@ -12,4 +13,5 @@ export declare const PaymentForm: ({ entityId, invoice, onFail, onPaymentSuccess
12
13
  graphQLClient: GraphQLClient;
13
14
  customCheckoutFunction?: ((plugin: PluginData | undefined) => Promise<any>) | undefined;
14
15
  currencyId?: string | undefined;
16
+ customPaymentForms?: Record<string, import("react").ReactNode> | undefined;
15
17
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,9 @@
1
1
  import "../../../styles/index.less";
2
2
  import { ShadowType } from "../../../types/shadowType";
3
- export declare const PaymentMethod: ({ entityId, className, shadow, cardEnabled, }: {
3
+ export declare const PaymentMethod: ({ entityId, className, shadow, cardEnabled, useModal, }: {
4
4
  entityId: string;
5
5
  className?: string | undefined;
6
6
  shadow?: ShadowType | undefined;
7
7
  cardEnabled?: boolean | undefined;
8
+ useModal?: boolean | undefined;
8
9
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,9 @@
1
+ /// <reference types="react" />
1
2
  import { PaymentMethod, PluginData } from "@bunnyapp/common";
2
- declare const PaymentMethodDetails: ({ onFail, paymentMethod, onSavePaymentMethod, }: {
3
+ declare const PaymentMethodDetails: ({ onFail, paymentMethod, onSavePaymentMethod, customPaymentForms, }: {
3
4
  onFail: (error: any) => void;
4
5
  paymentMethod: PaymentMethod | PluginData;
5
6
  onSavePaymentMethod: () => void;
7
+ customPaymentForms?: Record<string, import("react").ReactNode> | undefined;
6
8
  }) => import("react/jsx-runtime").JSX.Element | null;
7
9
  export default PaymentMethodDetails;
@@ -3,11 +3,11 @@ import { PluginData, Payable } from "@bunnyapp/common";
3
3
  export declare const createPaymentMethod: ({ paymentMethodId, plugin, token, apiHost, accountId, }: {
4
4
  paymentMethodId: string;
5
5
  plugin: PluginData;
6
- token: string;
6
+ token?: string | undefined;
7
7
  apiHost: string;
8
8
  accountId?: string | undefined;
9
9
  }) => Promise<any>;
10
- export declare const createSetupIntent: (plugin: PluginData, token: string, apiHost: string, accountId?: string) => Promise<any>;
10
+ export declare const createSetupIntent: (plugin: PluginData, apiHost: string, token?: string, accountId?: string) => Promise<any>;
11
11
  export declare const createPaymentIntent: ({ payable, savePaymentMethod, memo, plugin, token, apiHost, }: {
12
12
  payable: Payable;
13
13
  savePaymentMethod: boolean;
@@ -16,7 +16,7 @@ export declare const createPaymentIntent: ({ payable, savePaymentMethod, memo, p
16
16
  token: string;
17
17
  apiHost: string;
18
18
  }) => Promise<any>;
19
- export declare const useStripePlugin: (plugin: PluginData | undefined, token: string, apiHost: string, currencyId: string, accountId?: string) => {
19
+ export declare const useStripePlugin: (plugin: PluginData | undefined, apiHost: string, currencyId: string, token?: string, accountId?: string) => {
20
20
  stripe: Stripe | null;
21
21
  options: {
22
22
  mode: "setup";
@@ -1 +1,2 @@
1
1
  export { PaymentMethod } from "./PaymentMethod";
2
+ export { PaymentForm } from "./PaymentForm";
@@ -1,3 +1,3 @@
1
1
  import { PluginData } from "@bunnyapp/common";
2
- declare function useRemovePaymentMethod(paymentPlugins: PluginData[], token: string, apiHost: string, entityId: string, accountId?: string): (data: any) => Promise<void>;
2
+ declare function useRemovePaymentMethod(paymentPlugins: PluginData[], apiHost: string, entityId: string, token?: string, accountId?: string): (data: any) => Promise<void>;
3
3
  export default useRemovePaymentMethod;
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import { FrontendTransaction as T, TransactionKind } from "@bunnyapp/common";
3
3
  import { ShadowType } from "../../types/shadowType";
4
+ import { TransactionListColumnType } from "./transactionsList/TransactionsListDesktop";
4
5
  import { TransactionDateType } from "./TransactionsListContext";
5
6
  export default function Transactions({ transactionComponent, showSearchBar, showTitle, title, columns, className, shadow, searchBarClassName, useModal, onTransactionClick, suppressTransactionDisplay, kindsToShow, style, filter, noTransactionsMessage, entityId, filterTransactions, sortTransactions, transactionDateType, }: {
6
7
  /** A custom component to render instead of the default invoice component */
@@ -12,7 +13,7 @@ export default function Transactions({ transactionComponent, showSearchBar, show
12
13
  /** The title to display in the transactions list */
13
14
  title?: string;
14
15
  /** The columns to display in the transactions list */
15
- columns?: ("date-and-title" | "state" | "amount" | "download")[];
16
+ columns?: TransactionListColumnType[];
16
17
  /** A custom class name to apply to the component */
17
18
  className?: string;
18
19
  /** Whether to use a modal for the invoice drawer */
@@ -1,7 +1,7 @@
1
1
  import { FrontendTransaction as T } from "@bunnyapp/common";
2
2
  declare const TransactionDownload: ({ transaction, token, apiHost, }: {
3
3
  transaction: T.Transaction;
4
- token: string;
4
+ token?: string | undefined;
5
5
  apiHost: string;
6
6
  }) => import("react/jsx-runtime").JSX.Element | null;
7
7
  export default TransactionDownload;
@@ -1,5 +1,5 @@
1
1
  import { FrontendTransaction as T } from "@bunnyapp/common";
2
- export type TransactionListColumnType = "date-and-title" | "state" | "amount" | "download";
2
+ export type TransactionListColumnType = "date" | "title" | "state" | "amount" | "download" | "accountName";
3
3
  declare const TransactionsListDesktop: ({ transactions, onTransactionClick, }: {
4
4
  transactions: T.Transaction[];
5
5
  onTransactionClick?: ((transaction: T.Transaction) => void) | undefined;
@@ -1,7 +1,7 @@
1
1
  export { Invoice } from "./Invoice";
2
2
  export { Quote } from "./Quote";
3
3
  export { Quotes } from "./Quotes";
4
- export { PaymentMethod } from "./PaymentForm/PaymentMethod";
4
+ export { PaymentMethod, PaymentForm } from "./PaymentForm";
5
5
  export * from "./Checkout";
6
6
  export { Signup } from "./Signup";
7
7
  export { default as BunnyProvider } from "./BunnyProvider";
@@ -1,7 +1,7 @@
1
1
  declare const accountUpdate: ({ accountId, attributes, token, apiHost, }: {
2
2
  accountId: string;
3
3
  attributes: Record<string, string>;
4
- token: string;
4
+ token?: string | undefined;
5
5
  apiHost: string;
6
6
  }) => Promise<any>;
7
7
  export default accountUpdate;
@@ -1,6 +1,6 @@
1
1
  declare const billingDetailsUpdate: ({ attributes, token, apiHost, }: {
2
2
  attributes: Record<string, string>;
3
- token: string;
3
+ token?: string | undefined;
4
4
  apiHost: string;
5
5
  }) => Promise<any>;
6
6
  export default billingDetailsUpdate;
@@ -15,7 +15,7 @@ declare const checkout: ({ quoteId, invoiceId, paymentMethodId, paymentMethodDat
15
15
  savePaymentMethod?: boolean | undefined;
16
16
  metadata?: Record<string, any> | undefined;
17
17
  } | undefined;
18
- token: string;
18
+ token?: string | undefined;
19
19
  apiHost: string;
20
20
  }) => Promise<{
21
21
  savePaymentMethod: boolean | undefined;
@@ -4,7 +4,7 @@ type BillingContact = {
4
4
  email: string;
5
5
  };
6
6
  declare const quoteAccountSignup: ({ token, apiHost, entityId, priceListCode, accountName, billingContact, }: {
7
- token: string;
7
+ token?: string | undefined;
8
8
  apiHost: string;
9
9
  entityId: string;
10
10
  priceListCode: string;
@@ -2,7 +2,7 @@ import { Quote } from "@bunnyapp/common";
2
2
  declare const quoteAddCoupon: ({ quoteId, couponCode, token, apiHost, }: {
3
3
  quoteId?: string | undefined;
4
4
  couponCode?: string | undefined;
5
- token: string;
5
+ token?: string | undefined;
6
6
  apiHost: string;
7
7
  }) => Promise<Quote>;
8
8
  export default quoteAddCoupon;
@@ -1,6 +1,6 @@
1
1
  import BillingDetails from "../../types/billingDetails";
2
2
  declare const getBillingDetails: ({ token, apiHost, }: {
3
- token: string;
3
+ token?: string | undefined;
4
4
  apiHost: string;
5
5
  }) => Promise<BillingDetails>;
6
6
  export default getBillingDetails;
@@ -1,6 +1,6 @@
1
1
  import { EntityBranding } from "@bunnyapp/common";
2
2
  declare const getBranding: ({ token, apiHost, }: {
3
- token: string;
3
+ token?: string | undefined;
4
4
  apiHost: string;
5
5
  }) => Promise<EntityBranding>;
6
6
  export default getBranding;
@@ -4,7 +4,7 @@ declare const getFeatureUsage: ({ subscriptionChargeId, startDate, endDate, data
4
4
  startDate?: string | undefined;
5
5
  endDate?: string | undefined;
6
6
  dataInterval?: number | undefined;
7
- token: string;
7
+ token?: string | undefined;
8
8
  apiHost: string;
9
9
  }) => Promise<FeatureUsage>;
10
10
  export default getFeatureUsage;
@@ -2,6 +2,6 @@ import { FormattedQuote } from "@bunnyapp/common";
2
2
  declare const getFormattedQuote: ({ id, token, apiHost, }: {
3
3
  id?: string | undefined;
4
4
  apiHost: string;
5
- token: string;
5
+ token?: string | undefined;
6
6
  }) => Promise<FormattedQuote>;
7
7
  export default getFormattedQuote;
@@ -1,7 +1,7 @@
1
1
  import { Subscription } from "@bunnyapp/common";
2
2
  declare const getPlanChangeOptions: ({ isInPreviewMode, token, upgradingSubscription, apiHost, }: {
3
3
  isInPreviewMode?: boolean | undefined;
4
- token: string;
4
+ token?: string | undefined;
5
5
  upgradingSubscription?: Subscription | undefined;
6
6
  apiHost: string;
7
7
  }) => Promise<any>;
@@ -1,6 +1,6 @@
1
1
  import { PriceList } from "@bunnyapp/common";
2
2
  declare const getPriceList: ({ token, code, apiHost, }: {
3
- token: string;
3
+ token?: string | undefined;
4
4
  code: string;
5
5
  apiHost: string;
6
6
  }) => Promise<PriceList>;
@@ -1,5 +1,5 @@
1
1
  declare const getQuotes: ({ token, apiHost, filter, }: {
2
- token: string;
2
+ token?: string | undefined;
3
3
  apiHost: string;
4
4
  filter?: string | undefined;
5
5
  }) => Promise<any>;
@@ -2,6 +2,6 @@ declare const getSubscriptions: ({ apiHost, entityId, isInPreviewMode, token, }:
2
2
  apiHost: string;
3
3
  entityId: string;
4
4
  isInPreviewMode?: boolean | undefined;
5
- token: string;
5
+ token?: string | undefined;
6
6
  }) => Promise<any>;
7
7
  export default getSubscriptions;
@@ -1,3 +1,3 @@
1
1
  import { FrontendTransaction as T } from "@bunnyapp/common";
2
- declare const getTransactions: (filter: string, token: string, apiHost: string) => Promise<T.Transaction[]>;
2
+ declare const getTransactions: (filter: string, apiHost: string, token?: string) => Promise<T.Transaction[]>;
3
3
  export default getTransactions;
@@ -4,7 +4,7 @@ declare const useSendAcceptQuote: ({ entityId, onTokenExpired, quoteId, apiHost,
4
4
  onTokenExpired?: (() => void) | undefined;
5
5
  quoteId?: string | undefined;
6
6
  apiHost: string;
7
- token: string;
7
+ token?: string | undefined;
8
8
  }) => {
9
9
  acceptBoxVisible: boolean;
10
10
  isAccepting: boolean;
@@ -1,5 +1,5 @@
1
1
  declare const useSigningComplete: ({ data, token }: {
2
2
  data: any;
3
- token: string;
3
+ token?: string | undefined;
4
4
  }) => void;
5
5
  export default useSigningComplete;
@@ -1,2 +1,5 @@
1
1
  import { GraphQLClient } from "graphql-request";
2
- export declare const usePaymentMethod: (graphQLClient: GraphQLClient, entityId?: string, token?: string) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<any, Error>;
2
+ export declare const usePaymentMethod: (graphQLClient: GraphQLClient, entityId?: string, token?: string, accountId?: string) => {
3
+ data: any;
4
+ isLoading: boolean;
5
+ };
@@ -2,7 +2,7 @@ import { PluginData } from "@bunnyapp/common";
2
2
  export declare const usePaymentPlugins: ({ entityId, apiHost, token, }: {
3
3
  entityId: string;
4
4
  apiHost: string;
5
- token: string;
5
+ token?: string | undefined;
6
6
  }) => {
7
7
  paymentPlugins: PluginData[] | undefined;
8
8
  paymentMethodAllowedPlugins: PluginData[] | undefined;
@@ -1,6 +1,6 @@
1
1
  declare const usePlugins: ({ entityId, apiHost, token, }: {
2
2
  entityId: string;
3
3
  apiHost: string;
4
- token: string;
4
+ token?: string | undefined;
5
5
  }) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<any, Error>;
6
6
  export default usePlugins;
@@ -2,5 +2,5 @@ import { PluginData } from "@bunnyapp/common";
2
2
  export declare const useSigningPlugins: ({ entityId, apiHost, token, }: {
3
3
  entityId: string;
4
4
  apiHost: string;
5
- token: string;
5
+ token?: string | undefined;
6
6
  }) => PluginData[] | undefined;
@@ -1,2 +1,2 @@
1
- declare function useToken(): string;
1
+ declare function useToken(): string | undefined;
2
2
  export default useToken;
@@ -1,2 +1,2 @@
1
1
  import { GraphQLClient } from "graphql-request";
2
- export declare const createGraphQLClient: (token: string, apiHost: string) => GraphQLClient;
2
+ export declare const createGraphQLClient: (apiHost: string, token?: string) => GraphQLClient;
package/dist/index.d.ts CHANGED
@@ -1,12 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
- import { FormattedInvoice, FormattedQuote, FrontendTransaction, Quote as Quote$1, PriceList, PaymentMethod as PaymentMethod$1, TransactionKind, Subscription } from '@bunnyapp/common';
4
- import { QueryClient } from '@tanstack/react-query';
5
- import { ThemeConfig } from 'antd';
3
+ import { FormattedInvoice, FormattedQuote, FrontendTransaction, Quote as Quote$1, PluginData, PriceList, PaymentMethod as PaymentMethod$1, TransactionKind, Subscription } from '@bunnyapp/common';
6
4
  import * as react from 'react';
7
5
  import react__default from 'react';
8
- import * as _tanstack_react_query_build_legacy_types from '@tanstack/react-query/build/legacy/types';
9
6
  import { GraphQLClient } from 'graphql-request';
7
+ import { QueryClient } from '@tanstack/react-query';
8
+ import { ThemeConfig } from 'antd';
10
9
 
11
10
  type ShadowType = "shadow-none" | "shadow-sm" | "shadow-md" | "shadow-lg" | "shadow-xl";
12
11
 
@@ -37,7 +36,7 @@ declare global {
37
36
 
38
37
  declare function Quote({ id, invoiceQuoteViewComponent, onInvoiceDownloadError, onPaymentSuccess, entityId, shadow, className, hideDownloadButton, onQuoteLoaded, }: InvoiceQuoteContextProps): react_jsx_runtime.JSX.Element;
39
38
 
40
- type TransactionListColumnType = "date-and-title" | "state" | "amount" | "download";
39
+ type TransactionListColumnType = "date" | "title" | "state" | "amount" | "download" | "accountName";
41
40
 
42
41
  declare function Quotes({ className, columns, entityId, filter, filterQuotes, sort, noQuotesMessage, onQuoteClick, quoteComponent, searchBarClassName, shadow, showSearchBar, showTitle, title, style, suppressQuoteDisplay, useModal, }: {
43
42
  /** A custom component to render instead of the default invoice component */
@@ -75,11 +74,27 @@ declare function Quotes({ className, columns, entityId, filter, filterQuotes, so
75
74
  entityId: string;
76
75
  }): react_jsx_runtime.JSX.Element;
77
76
 
78
- declare const PaymentMethod: ({ entityId, className, shadow, cardEnabled, }: {
77
+ declare const PaymentMethod: ({ entityId, className, shadow, cardEnabled, useModal, }: {
79
78
  entityId: string;
80
79
  className?: string | undefined;
81
80
  shadow?: ShadowType | undefined;
82
81
  cardEnabled?: boolean | undefined;
82
+ useModal?: boolean | undefined;
83
+ }) => react_jsx_runtime.JSX.Element;
84
+
85
+ declare const PaymentForm: ({ entityId, invoice, onFail, onPaymentSuccess, quote, accountId, onSavePaymentMethod, overrideToken, graphQLClient, customCheckoutFunction, currencyId: currencyIdFromProps, customPaymentForms, }: {
86
+ entityId: string;
87
+ invoice?: FormattedInvoice | undefined;
88
+ quote?: Quote$1 | undefined;
89
+ onFail: (error: any) => void;
90
+ onPaymentSuccess?: (() => void) | undefined;
91
+ onSavePaymentMethod?: (() => void) | undefined;
92
+ accountId?: string | undefined;
93
+ overrideToken?: string | undefined;
94
+ graphQLClient: GraphQLClient;
95
+ customCheckoutFunction?: ((plugin: PluginData | undefined) => Promise<any>) | undefined;
96
+ currencyId?: string | undefined;
97
+ customPaymentForms?: Record<string, react.ReactNode> | undefined;
83
98
  }) => react_jsx_runtime.JSX.Element;
84
99
 
85
100
  type CheckoutProps = {
@@ -128,7 +143,7 @@ declare function BunnyProvider({ children, darkMode, queryClient, apiHost, token
128
143
  darkMode?: boolean;
129
144
  queryClient?: QueryClient;
130
145
  apiHost: string;
131
- token: string;
146
+ token?: string;
132
147
  onTokenExpired?: () => void;
133
148
  configProviderProps?: ThemeConfig | undefined;
134
149
  }): react_jsx_runtime.JSX.Element;
@@ -145,7 +160,7 @@ declare function Transactions({ transactionComponent, showSearchBar, showTitle,
145
160
  /** The title to display in the transactions list */
146
161
  title?: string;
147
162
  /** The columns to display in the transactions list */
148
- columns?: ("date-and-title" | "state" | "amount" | "download")[];
163
+ columns?: TransactionListColumnType[];
149
164
  /** A custom class name to apply to the component */
150
165
  className?: string;
151
166
  /** Whether to use a modal for the invoice drawer */
@@ -197,18 +212,22 @@ declare const Subscriptions: ({ className, companyName, entityId, hideExpired, o
197
212
  noSubscriptionsComponent?: React.ReactNode;
198
213
  }) => react_jsx_runtime.JSX.Element;
199
214
 
200
- declare const BillingDetails: ({ entityId, isCardEnabled, shadow, className, hidePaymentMethodForm, countryListFilter, }: {
215
+ declare const BillingDetails: ({ entityId, isCardEnabled, shadow, className, hidePaymentMethodForm, hideBillingDetailsForm, countryListFilter, }: {
201
216
  entityId: string;
202
217
  isCardEnabled?: boolean | undefined;
203
218
  shadow?: ShadowType | undefined;
204
219
  className?: string | undefined;
205
220
  hidePaymentMethodForm?: boolean | undefined;
221
+ hideBillingDetailsForm?: boolean | undefined;
206
222
  countryListFilter?: ((country: {
207
223
  value: string;
208
224
  label: string;
209
225
  }) => boolean) | undefined;
210
226
  }) => react_jsx_runtime.JSX.Element;
211
227
 
212
- declare const usePaymentMethod: (graphQLClient: GraphQLClient, entityId?: string, token?: string) => _tanstack_react_query_build_legacy_types.UseQueryResult<any, Error>;
228
+ declare const usePaymentMethod: (graphQLClient: GraphQLClient, entityId?: string, token?: string, accountId?: string) => {
229
+ data: any;
230
+ isLoading: boolean;
231
+ };
213
232
 
214
- export { BillingDetails, BunnyProvider, Checkout, Invoice, PaymentMethod, Quote, Quotes, Signup, Subscriptions, Transactions, getQuoteAmountDue, usePaymentMethod };
233
+ export { BillingDetails, BunnyProvider, Checkout, Invoice, PaymentForm, PaymentMethod, Quote, Quotes, Signup, Subscriptions, Transactions, getQuoteAmountDue, usePaymentMethod };
package/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "@bunnyapp/components",
3
- "version": "1.0.35",
3
+ "version": "1.0.37",
4
4
  "description": "Components from the Bunny portal to embed Bunny UI functionality into your application.",
5
- "main": "dist/esm/index.js",
5
+ "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
7
- "type": "module",
8
7
  "files": [
9
8
  "dist"
10
9
  ],