@bunnyapp/components 1.8.0-beta.23 → 1.8.0-beta.25

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 (42) hide show
  1. package/dist/cjs/index.js +293 -205
  2. package/dist/cjs/types/src/components/PaymentForm/PaymentForm.d.ts +3 -5
  3. package/dist/cjs/types/src/components/PaymentForm/context/CallbacksContext.d.ts +1 -1
  4. package/dist/cjs/types/src/components/Signup/Signup.d.ts +3 -8
  5. package/dist/cjs/types/src/components/Signup/SignupContent.d.ts +1 -1
  6. package/dist/cjs/types/src/components/Signup/components/CheckoutSummary/fragments/CheckoutSummary_QuoteFragment.d.ts +0 -2
  7. package/dist/cjs/types/src/components/Signup/components/LoadingOverlay.d.ts +4 -0
  8. package/dist/cjs/types/src/components/Signup/components/PriceListDisplay.d.ts +11 -1
  9. package/dist/cjs/types/src/components/Signup/components/QuoteCreateButton.d.ts +1 -4
  10. package/dist/cjs/types/src/components/Signup/consts.d.ts +1 -0
  11. package/dist/cjs/types/src/components/Signup/fragments/Signup_PriceListFragment.d.ts +0 -1
  12. package/dist/cjs/types/src/components/Signup/fragments/Signup_QuoteFragment.d.ts +3 -2
  13. package/dist/cjs/types/src/components/Signup/hooks/useApplyDefaultCoupon.d.ts +1 -10
  14. package/dist/cjs/types/src/components/Signup/hooks/useQuoteAccountSignupMutation.d.ts +1 -4
  15. package/dist/cjs/types/src/components/Signup/hooks/useSignupQuoteQueryData.d.ts +8 -1
  16. package/dist/cjs/types/src/components/Signup/queries/getSignupQuote.d.ts +10 -0
  17. package/dist/cjs/types/src/components/Signup/signup-quote/SignupQuote.d.ts +1 -1
  18. package/dist/cjs/types/src/utils/QueryKeyFactory.d.ts +5 -1
  19. package/dist/esm/index.js +294 -206
  20. package/dist/esm/types/src/components/PaymentForm/PaymentForm.d.ts +3 -5
  21. package/dist/esm/types/src/components/PaymentForm/context/CallbacksContext.d.ts +1 -1
  22. package/dist/esm/types/src/components/Signup/Signup.d.ts +3 -8
  23. package/dist/esm/types/src/components/Signup/SignupContent.d.ts +1 -1
  24. package/dist/esm/types/src/components/Signup/components/CheckoutSummary/fragments/CheckoutSummary_QuoteFragment.d.ts +0 -2
  25. package/dist/esm/types/src/components/Signup/components/LoadingOverlay.d.ts +4 -0
  26. package/dist/esm/types/src/components/Signup/components/PriceListDisplay.d.ts +11 -1
  27. package/dist/esm/types/src/components/Signup/components/QuoteCreateButton.d.ts +1 -4
  28. package/dist/esm/types/src/components/Signup/consts.d.ts +1 -0
  29. package/dist/esm/types/src/components/Signup/fragments/Signup_PriceListFragment.d.ts +0 -1
  30. package/dist/esm/types/src/components/Signup/fragments/Signup_QuoteFragment.d.ts +3 -2
  31. package/dist/esm/types/src/components/Signup/hooks/useApplyDefaultCoupon.d.ts +1 -10
  32. package/dist/esm/types/src/components/Signup/hooks/useQuoteAccountSignupMutation.d.ts +1 -4
  33. package/dist/esm/types/src/components/Signup/hooks/useSignupQuoteQueryData.d.ts +8 -1
  34. package/dist/esm/types/src/components/Signup/queries/getSignupQuote.d.ts +10 -0
  35. package/dist/esm/types/src/components/Signup/signup-quote/SignupQuote.d.ts +1 -1
  36. package/dist/esm/types/src/utils/QueryKeyFactory.d.ts +5 -1
  37. package/dist/index.d.ts +6 -12
  38. package/package.json +1 -1
  39. package/dist/cjs/types/src/components/Signup/fragments/useApplyDefaultCoupon_QuoteFragment.d.ts +0 -9
  40. package/dist/cjs/types/src/components/Signup/hooks/useQuoteAccountSignupOnExit.d.ts +0 -46
  41. package/dist/esm/types/src/components/Signup/fragments/useApplyDefaultCoupon_QuoteFragment.d.ts +0 -9
  42. package/dist/esm/types/src/components/Signup/hooks/useQuoteAccountSignupOnExit.d.ts +0 -46
@@ -19,7 +19,7 @@ export declare const PaymentForm_InvoiceFragment: import("gql.tada").TadaDocumen
19
19
  on: "Invoice";
20
20
  masked: true;
21
21
  }>;
22
- declare function PaymentFormRoot({ currencyId: accountCurrencyId, invoice: maskedInvoice, quote: maskedQuote, paymentHold, onPaymentSuccess, onPaymentHoldSuccess, paymentHoldPrecondition, accountId, onSavePaymentMethod, onPaymentMethodRemoved, onSetDefaultPaymentMethod, customCheckoutFunction, children, }: {
22
+ declare function PaymentFormRoot({ currencyId: accountCurrencyId, invoice: maskedInvoice, quote: maskedQuote, paymentHold, onPaymentSuccess, onPaymentHoldSuccess, checkoutPrecondition, accountId, onSavePaymentMethod, onPaymentMethodRemoved, onSetDefaultPaymentMethod, customCheckoutFunction, children, }: {
23
23
  currencyId?: string;
24
24
  invoice?: FragmentOf<typeof PaymentForm_InvoiceFragment>;
25
25
  quote?: FragmentOf<typeof PaymentForm_QuoteFragment>;
@@ -29,10 +29,8 @@ declare function PaymentFormRoot({ currencyId: accountCurrencyId, invoice: maske
29
29
  };
30
30
  onPaymentSuccess?: (response: any) => void;
31
31
  onPaymentHoldSuccess?: (response: any) => void;
32
- /**
33
- * If provided, the payment hold will only go through if this condition returns true.
34
- */
35
- paymentHoldPrecondition?: () => boolean | Promise<boolean>;
32
+ /** Precondition that must pass before checking out free/trial/paid/payment-hold quotes. */
33
+ checkoutPrecondition?: () => boolean | Promise<boolean>;
36
34
  onSavePaymentMethod?: (response: any) => void;
37
35
  onPaymentMethodRemoved?: (paymentMethod: PaymentMethodFragment) => void;
38
36
  onSetDefaultPaymentMethod?: () => void;
@@ -5,7 +5,7 @@ export type PaymentCallbacksContextValue = {
5
5
  onPaymentMethodRemoved: ((paymentMethod: PaymentMethodFragment) => void) | undefined;
6
6
  onSavePaymentMethod: ((response: any) => void) | undefined;
7
7
  onPaymentHoldSuccess: ((response: any) => void) | undefined;
8
- paymentHoldPrecondition: (() => boolean | Promise<boolean>) | undefined;
8
+ checkoutPrecondition: (() => boolean | Promise<boolean>) | undefined;
9
9
  };
10
10
  declare const PaymentFormCallbacksProvider: ({ value, children }: {
11
11
  value: PaymentCallbacksContextValue;
@@ -1,16 +1,9 @@
1
1
  import type { FormInstance } from "antd/es/form";
2
- import { ShadowType } from '../../types/shadowType';
3
2
  import { type DefaultSignupValues, InitialSignupFormData, type RequiredBillingDetailsFlags } from "./components/InitialSignupFormFields";
4
3
  export type SignupProps = {
5
4
  priceListCode: string;
6
5
  /** If trial is allowed on priceList, enableTrial will enable the trial for the signup */
7
6
  enableTrial?: boolean;
8
- /** The URL to redirect to after the signup is complete */
9
- returnUrl?: string;
10
- /** A custom class name to apply to the component */
11
- className?: string;
12
- /** The shadow level to apply to the component */
13
- shadow?: ShadowType;
14
7
  /** A custom style to apply to the component */
15
8
  style?: React.CSSProperties;
16
9
  /** The default form values to use for the signup */
@@ -21,6 +14,8 @@ export type SignupProps = {
21
14
  documentTemplateId?: string;
22
15
  /** Which account billing fields to show and require */
23
16
  requiredBillingDetails?: RequiredBillingDetailsFlags;
17
+ /** A default coupon code to pre-apply to the checkout */
18
+ defaultCouponCode?: string;
24
19
  };
25
20
  declare const useSignupPortalSessionToken: () => [string | undefined, import("react").Dispatch<import("react").SetStateAction<string | undefined>>];
26
21
  declare const useSignupAccountId: () => [string | undefined, import("react").Dispatch<import("react").SetStateAction<string | undefined>>];
@@ -30,5 +25,5 @@ declare const useSignupOptions: () => {
30
25
  enableTrial: boolean;
31
26
  paymentRequiredToAcceptQuote?: boolean;
32
27
  };
33
- export default function Signup({ priceListCode, enableTrial, returnUrl, className, shadow, style, defaultFormValues, paymentRequiredToAcceptQuote, documentTemplateId, requiredBillingDetails, }: SignupProps): import("react/jsx-runtime").JSX.Element;
28
+ export default function Signup({ priceListCode, enableTrial, style, defaultFormValues, paymentRequiredToAcceptQuote, documentTemplateId, requiredBillingDetails, defaultCouponCode, }: SignupProps): import("react/jsx-runtime").JSX.Element;
34
29
  export { useSignupAccountId, useSignupForm, useSignupOptions, useSignupPortalSessionToken, useSignupPurchaseSucceeded };
@@ -1,2 +1,2 @@
1
1
  import type { SignupProps } from './Signup';
2
- export declare function SignupContent({ priceListCode, defaultFormValues, documentTemplateId, requiredBillingDetails, returnUrl: returnUrlProp, style, }: SignupProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function SignupContent({ priceListCode, defaultFormValues, documentTemplateId, requiredBillingDetails, style, defaultCouponCode, }: SignupProps): import("react/jsx-runtime").JSX.Element;
@@ -21,8 +21,6 @@ export declare const CheckoutSummary_QuoteFragment: import("gql.tada").TadaDocum
21
21
  }[];
22
22
  }[] | null;
23
23
  [$tada.fragmentRefs]: {
24
- useApplyDefaultCoupon_QuoteFragment: "Quote";
25
- } & {
26
24
  canApplyCoupons_QuoteFragment: "Quote";
27
25
  };
28
26
  }, {}, {
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export default function LoadingOverlay({ style }: {
3
+ style?: React.CSSProperties;
4
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -14,6 +14,16 @@ export declare const PriceListDisplay_PriceListFragment: import("gql.tada").Tada
14
14
  on: "PriceList";
15
15
  masked: true;
16
16
  }>;
17
- export default function PriceListDisplay({ priceList: maskedPriceList }: {
17
+ export declare const PriceListDisplay_QuoteFragment: import("gql.tada").TadaDocumentNode<{
18
+ quoteChanges: {
19
+ isTrial: boolean;
20
+ }[] | null;
21
+ }, {}, {
22
+ fragment: "PriceListDisplay_QuoteFragment";
23
+ on: "Quote";
24
+ masked: true;
25
+ }>;
26
+ export default function PriceListDisplay({ priceList: maskedPriceList, quote: maskedQuote, }: {
18
27
  priceList: FragmentOf<typeof PriceListDisplay_PriceListFragment> | undefined | null;
28
+ quote?: FragmentOf<typeof PriceListDisplay_QuoteFragment> | undefined | null;
19
29
  }): import("react/jsx-runtime").JSX.Element | null;
@@ -1,9 +1,6 @@
1
1
  type QuoteCreateButtonProps = {
2
2
  priceListCode: string;
3
- priceList: {
4
- trialAllowed?: boolean;
5
- } | null | undefined;
6
3
  documentTemplateId?: string;
7
4
  };
8
- export default function QuoteCreateButton({ priceListCode, priceList, documentTemplateId, }: QuoteCreateButtonProps): import("react/jsx-runtime").JSX.Element;
5
+ export default function QuoteCreateButton({ priceListCode, documentTemplateId, }: QuoteCreateButtonProps): import("react/jsx-runtime").JSX.Element;
9
6
  export {};
@@ -0,0 +1 @@
1
+ export declare const SIGNUP_BACKGROUND_COLOR = "#f8fafc";
@@ -16,7 +16,6 @@ export declare const Signup_PriceListFragment: import("gql.tada").TadaDocumentNo
16
16
  } | null;
17
17
  code: string | null;
18
18
  currencyId: string;
19
- trialAllowed: boolean;
20
19
  }, {}, {
21
20
  fragment: "Signup_PriceListFragment";
22
21
  on: "PriceList";
@@ -1,7 +1,5 @@
1
1
  export declare const Signup_QuoteFragment: import("gql.tada").TadaDocumentNode<{
2
2
  [$tada.fragmentRefs]: {
3
- useApplyDefaultCoupon_QuoteFragment: "Quote";
4
- } & {
5
3
  CheckoutSummary_QuoteFragment: "Quote";
6
4
  } & {
7
5
  PaymentForm_QuoteFragment: "Quote";
@@ -9,12 +7,15 @@ export declare const Signup_QuoteFragment: import("gql.tada").TadaDocumentNode<{
9
7
  SignupPaymentForm_QuoteFragment: "Quote";
10
8
  } & {
11
9
  SignupQuote_QuoteFragment: "Quote";
10
+ } & {
11
+ PriceListDisplay_QuoteFragment: "Quote";
12
12
  };
13
13
  state: "APPROVED" | "REJECTED" | "DRAFT" | "SHARED" | "VIEWED" | "ACCEPTED" | "IN_APPROVAL" | "UNDONE";
14
14
  id: string | null;
15
15
  accountId: string;
16
16
  currencyId: string;
17
17
  amountDue: number | null;
18
+ amount: number;
18
19
  payToAccept: boolean | null;
19
20
  quoteChanges: {
20
21
  id: string | null;
@@ -1,13 +1,4 @@
1
- import { FragmentOf } from 'gql.tada';
2
- import { useApplyDefaultCoupon_QuoteFragment } from '../fragments/useApplyDefaultCoupon_QuoteFragment';
3
- /**
4
- * Applies a default coupon code once when quoteChangeId is available.
5
- * Uses a ref to ensure coupon code is only applied once.
6
- */
7
- export default function useApplyDefaultCoupon({ couponCode, quoteChangeId, quote: maskedQuote, activeCouponsExist, addCoupon, }: {
1
+ export default function useApplyDefaultCoupon({ couponCode, addCoupon, }: {
8
2
  couponCode: string | undefined;
9
- quoteChangeId: string | undefined;
10
- quote: FragmentOf<typeof useApplyDefaultCoupon_QuoteFragment> | undefined | null;
11
- activeCouponsExist: boolean;
12
3
  addCoupon: (code: string) => void;
13
4
  }): void;
@@ -4,14 +4,11 @@ import { Signup_QuoteFragment } from '../fragments/Signup_QuoteFragment';
4
4
  export type UseQuoteAccountSignupMutationOptions = {
5
5
  priceListCode: string;
6
6
  enableTrial: boolean;
7
- priceList: {
8
- trialAllowed?: boolean;
9
- } | null | undefined;
10
7
  paymentRequiredToAcceptQuote?: boolean;
11
8
  documentTemplateId?: string;
12
9
  onQuoteAccountSignupSuccess: (portalSessionToken: string, accountId: string, quote: FragmentOf<typeof Signup_QuoteFragment> | null) => void;
13
10
  };
14
- export declare function useQuoteAccountSignupMutation({ priceListCode, enableTrial, priceList, paymentRequiredToAcceptQuote, documentTemplateId, onQuoteAccountSignupSuccess, }: UseQuoteAccountSignupMutationOptions): import("@tanstack/react-query").UseMutationResult<{
11
+ export declare function useQuoteAccountSignupMutation({ priceListCode, enableTrial, paymentRequiredToAcceptQuote, documentTemplateId, onQuoteAccountSignupSuccess, }: UseQuoteAccountSignupMutationOptions): import("@tanstack/react-query").UseMutationResult<{
15
12
  account: {
16
13
  id: string;
17
14
  } | null;
@@ -2,4 +2,11 @@ import { ResultOf } from 'gql.tada';
2
2
  import { Signup_QuoteFragment } from '../fragments/Signup_QuoteFragment';
3
3
  export declare const useSignupQuoteQueryData: ({ tokenOverride, }: {
4
4
  tokenOverride?: string;
5
- }) => ResultOf<typeof Signup_QuoteFragment> | undefined;
5
+ }) => {
6
+ data: ResultOf<typeof Signup_QuoteFragment> | undefined;
7
+ refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<{
8
+ [$tada.fragmentRefs]: {
9
+ Signup_QuoteFragment: "Quote";
10
+ };
11
+ } | undefined, Error>>;
12
+ };
@@ -0,0 +1,10 @@
1
+ declare const getSignupQuote: ({ 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 getSignupQuote;
@@ -1,2 +1,2 @@
1
- declare const SignupQuote: () => import("react/jsx-runtime").JSX.Element | null;
1
+ declare const SignupQuote: () => import("react/jsx-runtime").JSX.Element;
2
2
  export default SignupQuote;
@@ -106,6 +106,10 @@ declare const QueryKeyFactory: {
106
106
  token?: string;
107
107
  }) => string[];
108
108
  paymentPluginsKey: (token?: string) => string[];
109
- accountForSignup: (token?: string) => string[];
109
+ signupAccount: (token?: string) => string[];
110
+ signupPriceList: (code?: string, token?: string) => string[];
110
111
  };
111
112
  export default QueryKeyFactory;
113
+ export declare const MutationKeyFactory: {
114
+ quoteAccountSignup: readonly ["quoteAccountSignup"];
115
+ };