@bunnyapp/components 1.8.0-beta.24 → 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.
- package/dist/cjs/index.js +264 -213
- package/dist/cjs/types/src/components/PaymentForm/PaymentForm.d.ts +3 -5
- package/dist/cjs/types/src/components/PaymentForm/context/CallbacksContext.d.ts +1 -1
- package/dist/cjs/types/src/components/Signup/Signup.d.ts +3 -8
- package/dist/cjs/types/src/components/Signup/SignupContent.d.ts +1 -1
- package/dist/cjs/types/src/components/Signup/components/CheckoutSummary/fragments/CheckoutSummary_QuoteFragment.d.ts +0 -2
- package/dist/cjs/types/src/components/Signup/components/PriceListDisplay.d.ts +11 -1
- package/dist/cjs/types/src/components/Signup/components/QuoteCreateButton.d.ts +1 -4
- package/dist/cjs/types/src/components/Signup/fragments/Signup_PriceListFragment.d.ts +0 -1
- package/dist/cjs/types/src/components/Signup/fragments/Signup_QuoteFragment.d.ts +3 -2
- package/dist/cjs/types/src/components/Signup/hooks/useApplyDefaultCoupon.d.ts +1 -10
- package/dist/cjs/types/src/components/Signup/hooks/useQuoteAccountSignupMutation.d.ts +1 -4
- package/dist/cjs/types/src/components/Signup/hooks/useSignupQuoteQueryData.d.ts +8 -1
- package/dist/cjs/types/src/components/Signup/queries/getSignupQuote.d.ts +10 -0
- package/dist/esm/index.js +265 -214
- package/dist/esm/types/src/components/PaymentForm/PaymentForm.d.ts +3 -5
- package/dist/esm/types/src/components/PaymentForm/context/CallbacksContext.d.ts +1 -1
- package/dist/esm/types/src/components/Signup/Signup.d.ts +3 -8
- package/dist/esm/types/src/components/Signup/SignupContent.d.ts +1 -1
- package/dist/esm/types/src/components/Signup/components/CheckoutSummary/fragments/CheckoutSummary_QuoteFragment.d.ts +0 -2
- package/dist/esm/types/src/components/Signup/components/PriceListDisplay.d.ts +11 -1
- package/dist/esm/types/src/components/Signup/components/QuoteCreateButton.d.ts +1 -4
- package/dist/esm/types/src/components/Signup/fragments/Signup_PriceListFragment.d.ts +0 -1
- package/dist/esm/types/src/components/Signup/fragments/Signup_QuoteFragment.d.ts +3 -2
- package/dist/esm/types/src/components/Signup/hooks/useApplyDefaultCoupon.d.ts +1 -10
- package/dist/esm/types/src/components/Signup/hooks/useQuoteAccountSignupMutation.d.ts +1 -4
- package/dist/esm/types/src/components/Signup/hooks/useSignupQuoteQueryData.d.ts +8 -1
- package/dist/esm/types/src/components/Signup/queries/getSignupQuote.d.ts +10 -0
- package/dist/index.d.ts +6 -12
- package/package.json +1 -1
- package/dist/cjs/types/src/components/Signup/fragments/useApplyDefaultCoupon_QuoteFragment.d.ts +0 -9
- package/dist/esm/types/src/components/Signup/fragments/useApplyDefaultCoupon_QuoteFragment.d.ts +0 -9
|
@@ -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,
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
|
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,
|
|
2
|
+
export declare function SignupContent({ priceListCode, defaultFormValues, documentTemplateId, requiredBillingDetails, style, defaultCouponCode, }: SignupProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -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
|
|
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,
|
|
5
|
+
export default function QuoteCreateButton({ priceListCode, documentTemplateId, }: QuoteCreateButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
9
6
|
export {};
|
|
@@ -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
|
-
|
|
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,
|
|
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
|
-
}) =>
|
|
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
|
+
};
|