@bunnyapp/components 1.8.0-beta.19 → 1.8.0-beta.20

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 (162) hide show
  1. package/dist/cjs/index.js +1999 -1377
  2. package/dist/cjs/types/src/components/DocumentTemplatePreview.d.ts +5 -1
  3. package/dist/cjs/types/src/components/Invoice/InvoiceQuoteView/DownloadQuoteButton.d.ts +5 -0
  4. package/dist/cjs/types/src/components/Invoice/InvoiceQuoteView/InvoiceQuoteView.d.ts +8 -0
  5. package/dist/cjs/types/src/components/Invoice/InvoiceQuoteView/InvoiceQuoteViewWithButtons.d.ts +14 -0
  6. package/dist/cjs/types/src/components/PaymentForm/PaymentForm.d.ts +4 -14
  7. package/dist/cjs/types/src/components/PaymentForm/Stripe/StripeFormProvider.d.ts +1 -2
  8. package/dist/cjs/types/src/components/PaymentForm/Stripe/stripeUtils.d.ts +1 -1
  9. package/dist/cjs/types/src/components/PaymentForm/components/CheckoutNoPayment.d.ts +5 -0
  10. package/dist/cjs/types/src/components/PaymentForm/components/Pay.d.ts +1 -0
  11. package/dist/cjs/types/src/components/PaymentForm/components/PaymentMethodDetails/components/Save.d.ts +9 -1
  12. package/dist/cjs/types/src/components/PaymentForm/components/StoredPaymentMethods.d.ts +0 -13
  13. package/dist/cjs/types/src/components/PaymentForm/context/PaymentProvider.d.ts +4 -0
  14. package/dist/cjs/types/src/components/PaymentForm/fragments/PaymentForm_QuoteFragment.d.ts +11 -0
  15. package/dist/cjs/types/src/components/PaymentForm/fragments/StoredPaymentMethods_PaymentMethodsFragment.d.ts +13 -0
  16. package/dist/cjs/types/src/components/PaymentForm/hooks/usePayableCurrency.d.ts +1 -1
  17. package/dist/cjs/types/src/components/Quote/components/QuoteIsAcceptedLabel.d.ts +6 -0
  18. package/dist/cjs/types/src/components/Quote/hooks/useAcceptQuote.d.ts +11 -6
  19. package/dist/cjs/types/src/components/Quote/queries/quoteAccept.d.ts +30 -6
  20. package/dist/cjs/types/src/components/QuoteProvider/fragments/quoteFragment.d.ts +0 -2
  21. package/dist/cjs/types/src/components/Signup/Signup.d.ts +25 -18
  22. package/dist/cjs/types/src/components/Signup/SignupContent.d.ts +2 -0
  23. package/dist/cjs/types/src/components/Signup/components/CheckoutSummary/CheckoutSummary.d.ts +5 -46
  24. package/dist/cjs/types/src/components/Signup/components/CheckoutSummary/components/CheckoutSummaryTotals.d.ts +11 -0
  25. package/dist/cjs/types/src/components/Signup/components/CheckoutSummary/fragments/CheckoutSummary_PriceListFragment.d.ts +21 -0
  26. package/dist/cjs/types/src/components/Signup/components/CheckoutSummary/fragments/CheckoutSummary_QuoteFragment.d.ts +32 -0
  27. package/dist/cjs/types/src/components/Signup/components/CheckoutSummary/totalsUtils.d.ts +9 -0
  28. package/dist/cjs/types/src/components/Signup/components/InitialSignupFormFields.d.ts +47 -0
  29. package/dist/cjs/types/src/components/Signup/components/Logo.d.ts +2 -0
  30. package/dist/cjs/types/src/components/Signup/components/PurchaseSuccessDisplay.d.ts +6 -0
  31. package/dist/cjs/types/src/components/Signup/components/QuoteCreateButton.d.ts +9 -0
  32. package/dist/cjs/types/src/components/Signup/components/SignupForm/SignupForm.d.ts +13 -0
  33. package/dist/cjs/types/src/components/Signup/components/SignupForm/components/ExistingAccountForm.d.ts +31 -0
  34. package/dist/cjs/types/src/components/Signup/components/SignupForm/components/ExistingAccountLoadedEffect.d.ts +34 -0
  35. package/dist/cjs/types/src/components/Signup/components/SignupForm/components/NewAccountForm.d.ts +8 -0
  36. package/dist/cjs/types/src/components/Signup/components/SignupForm/fragments/SignupForm_AccountFragment.d.ts +24 -0
  37. package/dist/cjs/types/src/components/Signup/components/SignupForm/hooks/useExistingAccount.d.ts +15 -0
  38. package/dist/cjs/types/src/components/Signup/components/SignupPaymentForm.d.ts +15 -0
  39. package/dist/cjs/types/src/components/Signup/components/SignupSplitScreenContainer.d.ts +6 -0
  40. package/dist/cjs/types/src/components/Signup/components/SuccessDisplay/SuccessDisplay.d.ts +10 -0
  41. package/dist/cjs/types/src/components/Signup/components/SuccessDisplay/components/SignupSuccessDisplay.d.ts +6 -0
  42. package/dist/cjs/types/src/components/Signup/components/SuccessDisplay/components/SuccessIcon.d.ts +2 -0
  43. package/dist/cjs/types/src/components/Signup/components/SuccessDisplay/components/ViewPortalSubscription.d.ts +5 -0
  44. package/dist/cjs/types/src/components/Signup/fragments/QuoteAcceptPage_PriceListFragment.d.ts +9 -0
  45. package/dist/cjs/types/src/components/Signup/fragments/SignupPaymentForm_QuoteFragment.d.ts +13 -0
  46. package/dist/cjs/types/src/components/Signup/fragments/Signup_PriceListFragment.d.ts +9 -2
  47. package/dist/cjs/types/src/components/Signup/fragments/Signup_QuoteFragment.d.ts +13 -2
  48. package/dist/cjs/types/src/components/Signup/fragments/useApplyDefaultCoupon_QuoteFragment.d.ts +9 -0
  49. package/dist/cjs/types/src/components/Signup/hooks/useAccountDetailsUpdate.d.ts +10 -0
  50. package/dist/cjs/types/src/components/Signup/hooks/useApplyDefaultCoupon.d.ts +1 -9
  51. package/dist/cjs/types/src/components/Signup/hooks/useApplySignupFormDefaults.d.ts +9 -0
  52. package/dist/cjs/types/src/components/Signup/hooks/useQuoteAccountSignupMutation.d.ts +32 -0
  53. package/dist/cjs/types/src/components/Signup/hooks/useQuoteAccountSignupOnExit.d.ts +46 -0
  54. package/dist/cjs/types/src/components/Signup/hooks/useQuoteRecalculateTaxes.d.ts +4 -0
  55. package/dist/cjs/types/src/components/Signup/hooks/useSetSignupQuoteQueryData.d.ts +5 -0
  56. package/dist/cjs/types/src/components/Signup/hooks/useSignupQuoteQueryData.d.ts +5 -0
  57. package/dist/cjs/types/src/components/Signup/mutations/contactUpdate.d.ts +12 -0
  58. package/dist/cjs/types/src/components/Signup/mutations/quoteAccountSignup.d.ts +6 -3
  59. package/dist/cjs/types/src/components/Signup/mutations/quoteChangeUpdate.d.ts +12 -0
  60. package/dist/cjs/types/src/components/Signup/mutations/quoteRecalculateTaxes.d.ts +1 -0
  61. package/dist/cjs/types/src/components/Signup/queries/getAccountByCode.d.ts +8 -0
  62. package/dist/cjs/types/src/components/Signup/queries/getAccountForSignupCompose.d.ts +20 -0
  63. package/dist/cjs/types/src/components/Signup/queries/getCurrentUserAccountForSignup.d.ts +14 -0
  64. package/dist/cjs/types/src/components/Signup/signup-quote/SignupQuote.d.ts +2 -0
  65. package/dist/cjs/types/src/components/Signup/signup-quote/SignupQuoteProvider.d.ts +9 -0
  66. package/dist/cjs/types/src/components/Signup/signup-quote/fragments/SignupQuote_QuoteFragment.d.ts +14 -0
  67. package/dist/cjs/types/src/components/Signup/utils/createPortalReturnUrl.d.ts +4 -0
  68. package/dist/cjs/types/src/graphql/mutations/quoteChangeAddCoupon.d.ts +4 -4
  69. package/dist/cjs/types/src/graphql/mutations/quoteChangeRemoveCoupon.d.ts +5 -2
  70. package/dist/cjs/types/src/hooks/usePaymentPlugins.d.ts +1 -1
  71. package/dist/cjs/types/src/hooks/useUpdateCoupons.d.ts +8 -2
  72. package/dist/cjs/types/src/utils/QueryKeyFactory.d.ts +4 -0
  73. package/dist/esm/index.js +2010 -1388
  74. package/dist/esm/types/src/components/DocumentTemplatePreview.d.ts +5 -1
  75. package/dist/esm/types/src/components/Invoice/InvoiceQuoteView/DownloadQuoteButton.d.ts +5 -0
  76. package/dist/esm/types/src/components/Invoice/InvoiceQuoteView/InvoiceQuoteView.d.ts +8 -0
  77. package/dist/esm/types/src/components/Invoice/InvoiceQuoteView/InvoiceQuoteViewWithButtons.d.ts +14 -0
  78. package/dist/esm/types/src/components/PaymentForm/PaymentForm.d.ts +4 -14
  79. package/dist/esm/types/src/components/PaymentForm/Stripe/StripeFormProvider.d.ts +1 -2
  80. package/dist/esm/types/src/components/PaymentForm/Stripe/stripeUtils.d.ts +1 -1
  81. package/dist/esm/types/src/components/PaymentForm/components/CheckoutNoPayment.d.ts +5 -0
  82. package/dist/esm/types/src/components/PaymentForm/components/Pay.d.ts +1 -0
  83. package/dist/esm/types/src/components/PaymentForm/components/PaymentMethodDetails/components/Save.d.ts +9 -1
  84. package/dist/esm/types/src/components/PaymentForm/components/StoredPaymentMethods.d.ts +0 -13
  85. package/dist/esm/types/src/components/PaymentForm/context/PaymentProvider.d.ts +4 -0
  86. package/dist/esm/types/src/components/PaymentForm/fragments/PaymentForm_QuoteFragment.d.ts +11 -0
  87. package/dist/esm/types/src/components/PaymentForm/fragments/StoredPaymentMethods_PaymentMethodsFragment.d.ts +13 -0
  88. package/dist/esm/types/src/components/PaymentForm/hooks/usePayableCurrency.d.ts +1 -1
  89. package/dist/esm/types/src/components/Quote/components/QuoteIsAcceptedLabel.d.ts +6 -0
  90. package/dist/esm/types/src/components/Quote/hooks/useAcceptQuote.d.ts +11 -6
  91. package/dist/esm/types/src/components/Quote/queries/quoteAccept.d.ts +30 -6
  92. package/dist/esm/types/src/components/QuoteProvider/fragments/quoteFragment.d.ts +0 -2
  93. package/dist/esm/types/src/components/Signup/Signup.d.ts +25 -18
  94. package/dist/esm/types/src/components/Signup/SignupContent.d.ts +2 -0
  95. package/dist/esm/types/src/components/Signup/components/CheckoutSummary/CheckoutSummary.d.ts +5 -46
  96. package/dist/esm/types/src/components/Signup/components/CheckoutSummary/components/CheckoutSummaryTotals.d.ts +11 -0
  97. package/dist/esm/types/src/components/Signup/components/CheckoutSummary/fragments/CheckoutSummary_PriceListFragment.d.ts +21 -0
  98. package/dist/esm/types/src/components/Signup/components/CheckoutSummary/fragments/CheckoutSummary_QuoteFragment.d.ts +32 -0
  99. package/dist/esm/types/src/components/Signup/components/CheckoutSummary/totalsUtils.d.ts +9 -0
  100. package/dist/esm/types/src/components/Signup/components/InitialSignupFormFields.d.ts +47 -0
  101. package/dist/esm/types/src/components/Signup/components/Logo.d.ts +2 -0
  102. package/dist/esm/types/src/components/Signup/components/PurchaseSuccessDisplay.d.ts +6 -0
  103. package/dist/esm/types/src/components/Signup/components/QuoteCreateButton.d.ts +9 -0
  104. package/dist/esm/types/src/components/Signup/components/SignupForm/SignupForm.d.ts +13 -0
  105. package/dist/esm/types/src/components/Signup/components/SignupForm/components/ExistingAccountForm.d.ts +31 -0
  106. package/dist/esm/types/src/components/Signup/components/SignupForm/components/ExistingAccountLoadedEffect.d.ts +34 -0
  107. package/dist/esm/types/src/components/Signup/components/SignupForm/components/NewAccountForm.d.ts +8 -0
  108. package/dist/esm/types/src/components/Signup/components/SignupForm/fragments/SignupForm_AccountFragment.d.ts +24 -0
  109. package/dist/esm/types/src/components/Signup/components/SignupForm/hooks/useExistingAccount.d.ts +15 -0
  110. package/dist/esm/types/src/components/Signup/components/SignupPaymentForm.d.ts +15 -0
  111. package/dist/esm/types/src/components/Signup/components/SignupSplitScreenContainer.d.ts +6 -0
  112. package/dist/esm/types/src/components/Signup/components/SuccessDisplay/SuccessDisplay.d.ts +10 -0
  113. package/dist/esm/types/src/components/Signup/components/SuccessDisplay/components/SignupSuccessDisplay.d.ts +6 -0
  114. package/dist/esm/types/src/components/Signup/components/SuccessDisplay/components/SuccessIcon.d.ts +2 -0
  115. package/dist/esm/types/src/components/Signup/components/SuccessDisplay/components/ViewPortalSubscription.d.ts +5 -0
  116. package/dist/esm/types/src/components/Signup/fragments/QuoteAcceptPage_PriceListFragment.d.ts +9 -0
  117. package/dist/esm/types/src/components/Signup/fragments/SignupPaymentForm_QuoteFragment.d.ts +13 -0
  118. package/dist/esm/types/src/components/Signup/fragments/Signup_PriceListFragment.d.ts +9 -2
  119. package/dist/esm/types/src/components/Signup/fragments/Signup_QuoteFragment.d.ts +13 -2
  120. package/dist/esm/types/src/components/Signup/fragments/useApplyDefaultCoupon_QuoteFragment.d.ts +9 -0
  121. package/dist/esm/types/src/components/Signup/hooks/useAccountDetailsUpdate.d.ts +10 -0
  122. package/dist/esm/types/src/components/Signup/hooks/useApplyDefaultCoupon.d.ts +1 -9
  123. package/dist/esm/types/src/components/Signup/hooks/useApplySignupFormDefaults.d.ts +9 -0
  124. package/dist/esm/types/src/components/Signup/hooks/useQuoteAccountSignupMutation.d.ts +32 -0
  125. package/dist/esm/types/src/components/Signup/hooks/useQuoteAccountSignupOnExit.d.ts +46 -0
  126. package/dist/esm/types/src/components/Signup/hooks/useQuoteRecalculateTaxes.d.ts +4 -0
  127. package/dist/esm/types/src/components/Signup/hooks/useSetSignupQuoteQueryData.d.ts +5 -0
  128. package/dist/esm/types/src/components/Signup/hooks/useSignupQuoteQueryData.d.ts +5 -0
  129. package/dist/esm/types/src/components/Signup/mutations/contactUpdate.d.ts +12 -0
  130. package/dist/esm/types/src/components/Signup/mutations/quoteAccountSignup.d.ts +6 -3
  131. package/dist/esm/types/src/components/Signup/mutations/quoteChangeUpdate.d.ts +12 -0
  132. package/dist/esm/types/src/components/Signup/mutations/quoteRecalculateTaxes.d.ts +1 -0
  133. package/dist/esm/types/src/components/Signup/queries/getAccountByCode.d.ts +8 -0
  134. package/dist/esm/types/src/components/Signup/queries/getAccountForSignupCompose.d.ts +20 -0
  135. package/dist/esm/types/src/components/Signup/queries/getCurrentUserAccountForSignup.d.ts +14 -0
  136. package/dist/esm/types/src/components/Signup/signup-quote/SignupQuote.d.ts +2 -0
  137. package/dist/esm/types/src/components/Signup/signup-quote/SignupQuoteProvider.d.ts +9 -0
  138. package/dist/esm/types/src/components/Signup/signup-quote/fragments/SignupQuote_QuoteFragment.d.ts +14 -0
  139. package/dist/esm/types/src/components/Signup/utils/createPortalReturnUrl.d.ts +4 -0
  140. package/dist/esm/types/src/graphql/mutations/quoteChangeAddCoupon.d.ts +4 -4
  141. package/dist/esm/types/src/graphql/mutations/quoteChangeRemoveCoupon.d.ts +5 -2
  142. package/dist/esm/types/src/hooks/usePaymentPlugins.d.ts +1 -1
  143. package/dist/esm/types/src/hooks/useUpdateCoupons.d.ts +8 -2
  144. package/dist/esm/types/src/utils/QueryKeyFactory.d.ts +4 -0
  145. package/dist/index.d.ts +55 -23
  146. package/package.json +3 -3
  147. package/dist/cjs/types/src/components/Invoice/InvoiceQuoteView.d.ts +0 -12
  148. package/dist/cjs/types/src/components/QuoteProvider/utils/getQuantityFromQuoteChange.d.ts +0 -11
  149. package/dist/cjs/types/src/components/Signup/PaymentForms.d.ts +0 -39
  150. package/dist/cjs/types/src/components/Signup/PaymentSuccess.d.ts +0 -8
  151. package/dist/cjs/types/src/components/Signup/mutations/accountSignup.d.ts +0 -58
  152. package/dist/cjs/types/src/components/Signup/queries/getQuote.d.ts +0 -10
  153. package/dist/cjs/types/src/graphql/mutations/quoteCompose.d.ts +0 -12
  154. package/dist/esm/types/src/components/Invoice/InvoiceQuoteView.d.ts +0 -12
  155. package/dist/esm/types/src/components/QuoteProvider/utils/getQuantityFromQuoteChange.d.ts +0 -11
  156. package/dist/esm/types/src/components/Signup/PaymentForms.d.ts +0 -39
  157. package/dist/esm/types/src/components/Signup/PaymentSuccess.d.ts +0 -8
  158. package/dist/esm/types/src/components/Signup/mutations/accountSignup.d.ts +0 -58
  159. package/dist/esm/types/src/components/Signup/queries/getQuote.d.ts +0 -10
  160. package/dist/esm/types/src/graphql/mutations/quoteCompose.d.ts +0 -12
  161. /package/dist/cjs/types/src/components/Signup/{PriceListDisplay.d.ts → components/PriceListDisplay.d.ts} +0 -0
  162. /package/dist/esm/types/src/components/Signup/{PriceListDisplay.d.ts → components/PriceListDisplay.d.ts} +0 -0
package/dist/index.d.ts CHANGED
@@ -96,17 +96,30 @@ declare function Quotes({ className, columns, filter, filterQuotes, sort, noQuot
96
96
  type Props = {
97
97
  className?: string;
98
98
  disabled?: boolean;
99
+ onClickPrecondition?: () => Promise<boolean>;
100
+ buttonTextOverride?: {
101
+ text: string;
102
+ isProcessingText: string;
103
+ };
99
104
  };
100
105
  declare function CheckoutNoPayment(props?: Props): react_jsx_runtime.JSX.Element;
101
106
 
102
107
  type PayProps = {
103
108
  disabled?: boolean;
109
+ onClickPrecondition?: () => boolean | Promise<boolean>;
104
110
  };
105
111
  declare function Pay(props?: PayProps): react_jsx_runtime.JSX.Element;
106
112
 
107
113
  declare function Cancel(): react_jsx_runtime.JSX.Element;
108
114
 
109
- declare function Save(): react_jsx_runtime.JSX.Element;
115
+ type SaveButtonTextOverride = {
116
+ text: string;
117
+ isProcessingText: string;
118
+ };
119
+ declare function Save({ onClickPrecondition, buttonTextOverride, }: {
120
+ onClickPrecondition?: () => boolean | Promise<boolean>;
121
+ buttonTextOverride?: SaveButtonTextOverride;
122
+ }): react_jsx_runtime.JSX.Element;
110
123
 
111
124
  type PaymentMethodDetailsProps = {
112
125
  footer?: ReactNode;
@@ -136,7 +149,6 @@ declare const PaymentForm_PaymentMethodsFragment: gql_tada.TadaDocumentNode<{
136
149
  masked: true;
137
150
  }>;
138
151
 
139
- type PaymentMethodFragment = ResultOf<typeof PaymentForm_PaymentMethodsFragment>;
140
152
  declare const PaymentForm_QuoteFragment: gql_tada.TadaDocumentNode<{
141
153
  id: string | null;
142
154
  currencyId: string;
@@ -148,6 +160,8 @@ declare const PaymentForm_QuoteFragment: gql_tada.TadaDocumentNode<{
148
160
  on: "Quote";
149
161
  masked: true;
150
162
  }>;
163
+
164
+ type PaymentMethodFragment = ResultOf<typeof PaymentForm_PaymentMethodsFragment>;
151
165
  declare const PaymentForm_InvoiceFragment: gql_tada.TadaDocumentNode<{
152
166
  id: string | null;
153
167
  currencyId: string;
@@ -159,7 +173,7 @@ declare const PaymentForm_InvoiceFragment: gql_tada.TadaDocumentNode<{
159
173
  on: "Invoice";
160
174
  masked: true;
161
175
  }>;
162
- declare function PaymentFormRoot({ currencyId: accountCurrencyId, invoice: maskedInvoice, quote: maskedQuote, paymentHold, onPaymentSuccess, onPaymentHoldSuccess, paymentHoldPrecondition, accountId, onSavePaymentMethod, onPaymentMethodRemoved, onSetDefaultPaymentMethod, overrideToken, customCheckoutFunction, children, }: {
176
+ declare function PaymentFormRoot({ currencyId: accountCurrencyId, invoice: maskedInvoice, quote: maskedQuote, paymentHold, onPaymentSuccess, onPaymentHoldSuccess, paymentHoldPrecondition, accountId, onSavePaymentMethod, onPaymentMethodRemoved, onSetDefaultPaymentMethod, customCheckoutFunction, children, }: {
163
177
  currencyId?: string;
164
178
  invoice?: FragmentOf<typeof PaymentForm_InvoiceFragment>;
165
179
  quote?: FragmentOf<typeof PaymentForm_QuoteFragment>;
@@ -177,16 +191,16 @@ declare function PaymentFormRoot({ currencyId: accountCurrencyId, invoice: maske
177
191
  onPaymentMethodRemoved?: (paymentMethod: PaymentMethodFragment) => void;
178
192
  onSetDefaultPaymentMethod?: () => void;
179
193
  accountId?: string;
180
- overrideToken?: string;
181
194
  customCheckoutFunction?: (pluginId: string, paymentMethodId: string) => Promise<any>;
182
195
  children?: ReactNode | ((state: PaymentFormRenderState) => ReactNode);
183
- }): react_jsx_runtime.JSX.Element | null;
196
+ }): react_jsx_runtime.JSX.Element;
184
197
  type PaymentFormProps = ComponentProps<typeof PaymentFormRoot>;
185
198
  type PaymentFormRenderState = {
186
199
  hasPaymentMethods: boolean;
187
200
  isPaymentMethodDetailsOpen: boolean;
188
201
  isPayableAvailable: boolean;
189
202
  amountDue: number | undefined;
203
+ paymentPluginsCount: number | undefined;
190
204
  };
191
205
  declare function PaymentFormInternal(props: PaymentFormProps & {
192
206
  disablePayButton?: boolean;
@@ -198,32 +212,50 @@ declare const PaymentForm: typeof PaymentFormInternal & {
198
212
  PaymentMethodDetails: typeof PaymentMethodDetails;
199
213
  };
200
214
 
201
- declare function Signup({ companyName, priceListCode, returnUrl, couponCode, className, shadow, style, defaultFirstName, defaultLastName, defaultEmail, defaultCompanyName, defaultBillingCountry, }: {
202
- /** The company name to display on the signup page */
203
- companyName: string;
204
- /** The price list code to use for the signup */
215
+ type DefaultSignupValues = {
216
+ firstName?: string;
217
+ lastName?: string;
218
+ email?: string;
219
+ accountName?: string;
220
+ billingCountry?: string;
221
+ billingState?: string;
222
+ billingCity?: string;
223
+ billingZip?: string;
224
+ billingStreet?: string;
225
+ taxNumber?: string;
226
+ };
227
+ /** Extra account billing fields (shown in “Account billing details”) when the flag is true. */
228
+ type RequiredBillingDetailsFlags = {
229
+ billingCountry?: boolean;
230
+ billingState?: boolean;
231
+ billingCity?: boolean;
232
+ billingZip?: boolean;
233
+ billingStreet?: boolean;
234
+ taxNumber?: boolean;
235
+ };
236
+
237
+ type SignupProps = {
205
238
  priceListCode: string;
206
- /** The return URL to that customers can be redirected to after signup */
239
+ /** If trial is allowed on priceList, enableTrial will enable the trial for the signup */
240
+ enableTrial?: boolean;
241
+ /** The URL to redirect to after the signup is complete */
207
242
  returnUrl?: string;
208
- /** An optional coupon code that gets applied automatically */
209
- couponCode?: string;
210
243
  /** A custom class name to apply to the component */
211
244
  className?: string;
212
245
  /** The shadow level to apply to the component */
213
246
  shadow?: ShadowType;
214
247
  /** A custom style to apply to the component */
215
248
  style?: React.CSSProperties;
216
- /** The default first name to use for the signup */
217
- defaultFirstName?: string;
218
- /** The default last name to use for the signup */
219
- defaultLastName?: string;
220
- /** The default email to use for the signup */
221
- defaultEmail?: string;
222
- /** The default company name to use for the signup */
223
- defaultCompanyName?: string;
224
- /** The default billing country to use for the signup */
225
- defaultBillingCountry?: string;
226
- }): react_jsx_runtime.JSX.Element;
249
+ /** The default form values to use for the signup */
250
+ defaultFormValues?: DefaultSignupValues;
251
+ /** Whether to require quote acceptance before checking out */
252
+ paymentRequiredToAcceptQuote?: boolean;
253
+ /** The document template ID to apply to the quote for the signup */
254
+ documentTemplateId?: string;
255
+ /** Which account billing fields to show and require. Omit for legacy behavior (country required only). */
256
+ requiredBillingDetails?: RequiredBillingDetailsFlags;
257
+ };
258
+ declare function Signup({ priceListCode, enableTrial, returnUrl, className, shadow, style, defaultFormValues, paymentRequiredToAcceptQuote, documentTemplateId, requiredBillingDetails, }: SignupProps): react_jsx_runtime.JSX.Element;
227
259
 
228
260
  declare function BunnyProvider({ children, darkMode, queryClient, apiHost, token, onTokenExpired, onUserUnavailable, onInvalidOrMissingAuthorization, suppressUserUnavailableErrorNotification, configProviderProps, }: {
229
261
  children: React.ReactNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bunnyapp/components",
3
- "version": "1.8.0-beta.19",
3
+ "version": "1.8.0-beta.20",
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",
@@ -34,7 +34,7 @@
34
34
  "@rollup/plugin-json": "^6.1.0",
35
35
  "@rollup/plugin-node-resolve": "^16.0.3",
36
36
  "@rollup/plugin-replace": "^6.0.2",
37
- "@rollup/plugin-terser": "^0.4.4",
37
+ "@rollup/plugin-terser": "^1.0.0",
38
38
  "@rollup/plugin-typescript": "^11.1.6",
39
39
  "@storybook/addon-essentials": "^8.6.14",
40
40
  "@storybook/addon-interactions": "^8.6.14",
@@ -62,7 +62,7 @@
62
62
  "patch-package": "^8.0.1",
63
63
  "postcss-import": "^16.1.1",
64
64
  "postcss-less": "^6.0.0",
65
- "postcss-url": "^10.1.3",
65
+ "postcss-url": "^8.0.0",
66
66
  "rimraf": "^6.1.2",
67
67
  "rollup": "^3.29.5",
68
68
  "rollup-plugin-dts": "^6.2.3",
@@ -1,12 +0,0 @@
1
- import FormattedInvoice from '@/types/FormattedInvoice';
2
- import { ReactNode } from 'react';
3
- declare const InvoiceQuoteView: ({ children, formattedInvoice, html, backButtonName, onBackButtonClick, onDownloadError, targetUrl, }: {
4
- html: string | null;
5
- children?: ReactNode;
6
- formattedInvoice?: FormattedInvoice;
7
- backButtonName?: string;
8
- onBackButtonClick?: () => void;
9
- onDownloadError?: () => void;
10
- targetUrl?: string;
11
- }) => import("react/jsx-runtime").JSX.Element;
12
- export default InvoiceQuoteView;
@@ -1,11 +0,0 @@
1
- export declare function getQuantityFromQuoteChange(quoteChange: {
2
- priceList: {
3
- id: string;
4
- } | null;
5
- charges: {
6
- feature: {
7
- id: string;
8
- } | null;
9
- quantity: number | null;
10
- }[];
11
- } | null, featureId: string): number | null | undefined;
@@ -1,39 +0,0 @@
1
- import { FragmentOf } from 'gql.tada';
2
- export declare const PaymentForms_QuoteFragment: import("gql.tada").TadaDocumentNode<{
3
- [$tada.fragmentRefs]: {
4
- PaymentForm_QuoteFragment: "Quote";
5
- };
6
- }, {}, {
7
- fragment: "PaymentForms_QuoteFragment";
8
- on: "Quote";
9
- masked: true;
10
- }>;
11
- export default function PaymentForms({ quote: maskedQuote, handlePaymentSuccess, handleSubmit, proceedingToPayment, accountId, overrideToken, customCheckoutFunction, defaultValues, }: {
12
- quote?: FragmentOf<typeof PaymentForms_QuoteFragment> | null;
13
- handlePaymentSuccess: () => void;
14
- handleSubmit: (formData: FormData) => void;
15
- proceedingToPayment: boolean;
16
- accountId?: string;
17
- overrideToken?: string;
18
- customCheckoutFunction?: (pluginId: string, paymentMethodId: string) => Promise<any>;
19
- defaultValues?: DefaultSignupValues;
20
- }): import("react/jsx-runtime").JSX.Element;
21
- export type FormData = {
22
- firstName: string;
23
- lastName: string;
24
- email: string;
25
- accountName: string;
26
- billingCountry: string;
27
- billingState: string;
28
- billingCity: string;
29
- billingZip: string;
30
- billingStreet: string;
31
- taxNumber: string;
32
- };
33
- export type DefaultSignupValues = {
34
- firstName?: string;
35
- lastName?: string;
36
- email?: string;
37
- accountName?: string;
38
- billingCountry?: string;
39
- };
@@ -1,8 +0,0 @@
1
- export default function PaymentSuccessDisplay({ amountPaid, className, companyName, returnUrl, style, currencyId, }: {
2
- amountPaid: number;
3
- className: string;
4
- companyName: string;
5
- returnUrl?: string;
6
- style?: React.CSSProperties;
7
- currencyId: string;
8
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,58 +0,0 @@
1
- declare const accountSignup: ({ token, apiHost, accountId, quoteId, paymentToken, paymentMethodId, pluginId, priceListCode, }: {
2
- token: string;
3
- apiHost: string;
4
- accountId: string;
5
- quoteId: string;
6
- paymentToken?: string;
7
- paymentMethodId?: string;
8
- pluginId: string;
9
- priceListCode: string;
10
- }) => Promise<{
11
- errors: string[] | null;
12
- quote: {
13
- accountId: string;
14
- amount: number;
15
- amountDue: number | null;
16
- applicationDate: unknown;
17
- applied: boolean;
18
- backdatedPeriods: boolean | null;
19
- backdatedQuote: boolean | null;
20
- billingDay: number | null;
21
- contactId: string | null;
22
- createdAt: unknown;
23
- credits: number | null;
24
- currencyId: string;
25
- dealId: string | null;
26
- discount: number | null;
27
- discountValue: number;
28
- endDate: unknown;
29
- evergreen: boolean | null;
30
- expiresAt: unknown;
31
- id: string | null;
32
- invoiceImmediately: boolean | null;
33
- invoiceImmediatelyAvailable: boolean | null;
34
- invoiceUntil: unknown;
35
- isPendingApprovalRequest: boolean;
36
- kind: "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "COUPON" | "DISCOUNT" | "PERCENTAGE_DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | "ACTIVATE";
37
- message: string | null;
38
- name: string | null;
39
- netPaymentDays: number | null;
40
- notes: string | null;
41
- number: string | null;
42
- ownerId: string | null;
43
- payableId: string | null;
44
- periodAmount: number | null;
45
- poNumber: string | null;
46
- requiresApproval: boolean;
47
- smallUnitAmountDue: number | null;
48
- splitInvoice: boolean | null;
49
- startDate: unknown;
50
- state: "APPROVED" | "REJECTED" | "DRAFT" | "SHARED" | "VIEWED" | "ACCEPTED" | "IN_APPROVAL" | "UNDONE";
51
- subtotal: number;
52
- taxAmount: number;
53
- taxCode: string | null;
54
- updatedAt: unknown;
55
- uuid: string;
56
- } | null;
57
- } | null>;
58
- export default accountSignup;
@@ -1,10 +0,0 @@
1
- declare const getQuote: ({ id, token, apiHost, }: {
2
- id: string;
3
- token?: string;
4
- apiHost: string;
5
- }) => Promise<{
6
- [$tada.fragmentRefs]: {
7
- Signup_QuoteFragment: "Quote";
8
- };
9
- } | null>;
10
- export default getQuote;
@@ -1,12 +0,0 @@
1
- import { Quote } from '@/types/Quote';
2
- type Options = {
3
- quoteId?: string;
4
- priceListId?: string;
5
- subscriptionId?: string;
6
- quantity?: number;
7
- accountId?: string;
8
- token?: string;
9
- apiHost: string;
10
- };
11
- declare const quoteCompose: ({ quoteId, priceListId, subscriptionId, quantity, accountId, token, apiHost, }: Options) => Promise<Quote>;
12
- export default quoteCompose;
@@ -1,12 +0,0 @@
1
- import FormattedInvoice from '@/types/FormattedInvoice';
2
- import { ReactNode } from 'react';
3
- declare const InvoiceQuoteView: ({ children, formattedInvoice, html, backButtonName, onBackButtonClick, onDownloadError, targetUrl, }: {
4
- html: string | null;
5
- children?: ReactNode;
6
- formattedInvoice?: FormattedInvoice;
7
- backButtonName?: string;
8
- onBackButtonClick?: () => void;
9
- onDownloadError?: () => void;
10
- targetUrl?: string;
11
- }) => import("react/jsx-runtime").JSX.Element;
12
- export default InvoiceQuoteView;
@@ -1,11 +0,0 @@
1
- export declare function getQuantityFromQuoteChange(quoteChange: {
2
- priceList: {
3
- id: string;
4
- } | null;
5
- charges: {
6
- feature: {
7
- id: string;
8
- } | null;
9
- quantity: number | null;
10
- }[];
11
- } | null, featureId: string): number | null | undefined;
@@ -1,39 +0,0 @@
1
- import { FragmentOf } from 'gql.tada';
2
- export declare const PaymentForms_QuoteFragment: import("gql.tada").TadaDocumentNode<{
3
- [$tada.fragmentRefs]: {
4
- PaymentForm_QuoteFragment: "Quote";
5
- };
6
- }, {}, {
7
- fragment: "PaymentForms_QuoteFragment";
8
- on: "Quote";
9
- masked: true;
10
- }>;
11
- export default function PaymentForms({ quote: maskedQuote, handlePaymentSuccess, handleSubmit, proceedingToPayment, accountId, overrideToken, customCheckoutFunction, defaultValues, }: {
12
- quote?: FragmentOf<typeof PaymentForms_QuoteFragment> | null;
13
- handlePaymentSuccess: () => void;
14
- handleSubmit: (formData: FormData) => void;
15
- proceedingToPayment: boolean;
16
- accountId?: string;
17
- overrideToken?: string;
18
- customCheckoutFunction?: (pluginId: string, paymentMethodId: string) => Promise<any>;
19
- defaultValues?: DefaultSignupValues;
20
- }): import("react/jsx-runtime").JSX.Element;
21
- export type FormData = {
22
- firstName: string;
23
- lastName: string;
24
- email: string;
25
- accountName: string;
26
- billingCountry: string;
27
- billingState: string;
28
- billingCity: string;
29
- billingZip: string;
30
- billingStreet: string;
31
- taxNumber: string;
32
- };
33
- export type DefaultSignupValues = {
34
- firstName?: string;
35
- lastName?: string;
36
- email?: string;
37
- accountName?: string;
38
- billingCountry?: string;
39
- };
@@ -1,8 +0,0 @@
1
- export default function PaymentSuccessDisplay({ amountPaid, className, companyName, returnUrl, style, currencyId, }: {
2
- amountPaid: number;
3
- className: string;
4
- companyName: string;
5
- returnUrl?: string;
6
- style?: React.CSSProperties;
7
- currencyId: string;
8
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,58 +0,0 @@
1
- declare const accountSignup: ({ token, apiHost, accountId, quoteId, paymentToken, paymentMethodId, pluginId, priceListCode, }: {
2
- token: string;
3
- apiHost: string;
4
- accountId: string;
5
- quoteId: string;
6
- paymentToken?: string;
7
- paymentMethodId?: string;
8
- pluginId: string;
9
- priceListCode: string;
10
- }) => Promise<{
11
- errors: string[] | null;
12
- quote: {
13
- accountId: string;
14
- amount: number;
15
- amountDue: number | null;
16
- applicationDate: unknown;
17
- applied: boolean;
18
- backdatedPeriods: boolean | null;
19
- backdatedQuote: boolean | null;
20
- billingDay: number | null;
21
- contactId: string | null;
22
- createdAt: unknown;
23
- credits: number | null;
24
- currencyId: string;
25
- dealId: string | null;
26
- discount: number | null;
27
- discountValue: number;
28
- endDate: unknown;
29
- evergreen: boolean | null;
30
- expiresAt: unknown;
31
- id: string | null;
32
- invoiceImmediately: boolean | null;
33
- invoiceImmediatelyAvailable: boolean | null;
34
- invoiceUntil: unknown;
35
- isPendingApprovalRequest: boolean;
36
- kind: "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "COUPON" | "DISCOUNT" | "PERCENTAGE_DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | "ACTIVATE";
37
- message: string | null;
38
- name: string | null;
39
- netPaymentDays: number | null;
40
- notes: string | null;
41
- number: string | null;
42
- ownerId: string | null;
43
- payableId: string | null;
44
- periodAmount: number | null;
45
- poNumber: string | null;
46
- requiresApproval: boolean;
47
- smallUnitAmountDue: number | null;
48
- splitInvoice: boolean | null;
49
- startDate: unknown;
50
- state: "APPROVED" | "REJECTED" | "DRAFT" | "SHARED" | "VIEWED" | "ACCEPTED" | "IN_APPROVAL" | "UNDONE";
51
- subtotal: number;
52
- taxAmount: number;
53
- taxCode: string | null;
54
- updatedAt: unknown;
55
- uuid: string;
56
- } | null;
57
- } | null>;
58
- export default accountSignup;
@@ -1,10 +0,0 @@
1
- declare const getQuote: ({ id, token, apiHost, }: {
2
- id: string;
3
- token?: string;
4
- apiHost: string;
5
- }) => Promise<{
6
- [$tada.fragmentRefs]: {
7
- Signup_QuoteFragment: "Quote";
8
- };
9
- } | null>;
10
- export default getQuote;
@@ -1,12 +0,0 @@
1
- import { Quote } from '@/types/Quote';
2
- type Options = {
3
- quoteId?: string;
4
- priceListId?: string;
5
- subscriptionId?: string;
6
- quantity?: number;
7
- accountId?: string;
8
- token?: string;
9
- apiHost: string;
10
- };
11
- declare const quoteCompose: ({ quoteId, priceListId, subscriptionId, quantity, accountId, token, apiHost, }: Options) => Promise<Quote>;
12
- export default quoteCompose;