@bunnyapp/components 1.8.0-beta.53 → 1.8.0-beta.55
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 +14 -14
- package/dist/cjs/types/src/components/Signup/Signup.d.ts +6 -3
- package/dist/cjs/types/src/components/Signup/Signup.stories.d.ts +1 -0
- package/dist/cjs/types/src/components/Signup/SignupContent.d.ts +1 -1
- package/dist/cjs/types/src/components/Signup/components/InitialSignupFormFields.d.ts +1 -2
- package/dist/cjs/types/src/components/Signup/components/SignupForm/SignupForm.d.ts +1 -4
- package/dist/cjs/types/src/components/Signup/components/SignupForm/components/ExistingAccountForm.d.ts +2 -4
- package/dist/cjs/types/src/components/Signup/components/SignupForm/components/NewAccountForm.d.ts +2 -4
- package/dist/cjs/types/src/components/Signup/contexts/SignupFormOptionsContext.d.ts +24 -0
- package/dist/cjs/types/src/components/Signup/index.d.ts +3 -0
- package/dist/cjs/types/src/components/index.d.ts +1 -0
- package/dist/esm/index.js +18 -18
- package/dist/esm/types/src/components/Signup/Signup.d.ts +6 -3
- package/dist/esm/types/src/components/Signup/Signup.stories.d.ts +1 -0
- package/dist/esm/types/src/components/Signup/SignupContent.d.ts +1 -1
- package/dist/esm/types/src/components/Signup/components/InitialSignupFormFields.d.ts +1 -2
- package/dist/esm/types/src/components/Signup/components/SignupForm/SignupForm.d.ts +1 -4
- package/dist/esm/types/src/components/Signup/components/SignupForm/components/ExistingAccountForm.d.ts +2 -4
- package/dist/esm/types/src/components/Signup/components/SignupForm/components/NewAccountForm.d.ts +2 -4
- package/dist/esm/types/src/components/Signup/contexts/SignupFormOptionsContext.d.ts +24 -0
- package/dist/esm/types/src/components/Signup/index.d.ts +3 -0
- package/dist/esm/types/src/components/index.d.ts +1 -0
- package/dist/index.d.ts +24 -3
- package/package.json +1 -1
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import type { FormInstance } from "antd/es/form";
|
|
2
2
|
import { type DefaultSignupValues, InitialSignupFormData, type RequiredBillingDetailsFlags } from "./components/InitialSignupFormFields";
|
|
3
3
|
import { type SignupCallbacks } from './contexts/SignupCallbacksContext';
|
|
4
|
+
import { type SignupFormOptions } from './contexts/SignupFormOptionsContext';
|
|
4
5
|
export type SignupProps = {
|
|
5
6
|
priceListCode: string;
|
|
6
7
|
/** If trial is allowed on priceList, enableTrial will enable the trial for the signup */
|
|
7
8
|
enableTrial?: boolean;
|
|
8
9
|
/** A custom style to apply to the component */
|
|
9
10
|
style?: React.CSSProperties;
|
|
10
|
-
/**
|
|
11
|
+
/** Form configuration: default values, required billing details and disabled fields */
|
|
12
|
+
form?: SignupFormOptions;
|
|
13
|
+
/** @deprecated Use `form.defaultValues` instead */
|
|
11
14
|
defaultFormValues?: DefaultSignupValues;
|
|
12
15
|
/** Whether to require quote acceptance before checking out */
|
|
13
16
|
paymentRequiredToAcceptQuote?: boolean;
|
|
14
17
|
/** The document template ID to apply to the quote for the signup */
|
|
15
18
|
documentTemplateId?: string;
|
|
16
|
-
/**
|
|
19
|
+
/** @deprecated Use `form.requiredBillingDetails` instead */
|
|
17
20
|
requiredBillingDetails?: RequiredBillingDetailsFlags;
|
|
18
21
|
/** A default coupon code to pre-apply to the checkout */
|
|
19
22
|
defaultCouponCode?: string;
|
|
@@ -28,5 +31,5 @@ declare const useSignupOptions: () => {
|
|
|
28
31
|
enableTrial: boolean;
|
|
29
32
|
paymentRequiredToAcceptQuote?: boolean;
|
|
30
33
|
};
|
|
31
|
-
export default function Signup({ priceListCode, enableTrial, style, defaultFormValues, paymentRequiredToAcceptQuote, documentTemplateId, requiredBillingDetails, defaultCouponCode, callbacks, }: SignupProps): import("react").JSX.Element;
|
|
34
|
+
export default function Signup({ priceListCode, enableTrial, style, form, defaultFormValues, paymentRequiredToAcceptQuote, documentTemplateId, requiredBillingDetails, defaultCouponCode, callbacks, }: SignupProps): import("react").JSX.Element;
|
|
32
35
|
export { useSignupAccountId, useSignupForm, useSignupOptions, useSignupPortalSessionToken, useSignupPurchaseSucceeded };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { SignupProps } from './Signup';
|
|
2
|
-
export declare function SignupContent({ priceListCode,
|
|
2
|
+
export declare function SignupContent({ priceListCode, documentTemplateId, style, defaultCouponCode, }: Pick<SignupProps, 'priceListCode' | 'documentTemplateId' | 'style' | 'defaultCouponCode'>): import("react").JSX.Element;
|
|
@@ -36,11 +36,10 @@ export type RequiredBillingDetailsFlags = {
|
|
|
36
36
|
};
|
|
37
37
|
/** Optional fields not shown by default; enabled via `extraFieldsToShow`. */
|
|
38
38
|
export type ExtraSignupFormField = 'title';
|
|
39
|
-
export default function InitialSignupFormFields({ className,
|
|
39
|
+
export default function InitialSignupFormFields({ className,
|
|
40
40
|
/** Called when focus leaves this form (e.g. tab to payment). Implemented via Form `onBlurCapture` so moving between fields does not fire. */
|
|
41
41
|
onBlur, disabled, extraFieldsToShow, }: {
|
|
42
42
|
className?: string;
|
|
43
|
-
requiredBillingDetails?: RequiredBillingDetailsFlags;
|
|
44
43
|
onBlur?: () => void;
|
|
45
44
|
disabled?: boolean;
|
|
46
45
|
extraFieldsToShow?: ExtraSignupFormField[];
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import type { ResultOf } from 'gql.tada';
|
|
2
2
|
import { Signup_PriceListFragment } from '../../fragments/Signup_PriceListFragment';
|
|
3
|
-
import { type DefaultSignupValues, type RequiredBillingDetailsFlags } from '../InitialSignupFormFields';
|
|
4
3
|
type SignupFormProps = {
|
|
5
4
|
priceList?: ResultOf<typeof Signup_PriceListFragment> | null;
|
|
6
|
-
defaultFormValues?: DefaultSignupValues;
|
|
7
|
-
requiredBillingDetails?: RequiredBillingDetailsFlags;
|
|
8
5
|
};
|
|
9
|
-
export default function SignupForm({ priceList
|
|
6
|
+
export default function SignupForm({ priceList }: SignupFormProps): import("react").JSX.Element;
|
|
10
7
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FragmentOf, type ResultOf } from 'gql.tada';
|
|
2
2
|
import { Signup_PriceListFragment } from '../../../fragments/Signup_PriceListFragment';
|
|
3
|
-
import { ExtraSignupFormField
|
|
3
|
+
import { ExtraSignupFormField } from '../../InitialSignupFormFields';
|
|
4
4
|
export declare const ExistingAccountForm_AccountFragment: import("gql.tada").TadaDocumentNode<{
|
|
5
5
|
[$tada.fragmentRefs]: {
|
|
6
6
|
ExistingAccountLoadedEffect_AccountFragment: "Account";
|
|
@@ -15,13 +15,11 @@ export declare const ExistingAccountForm_AccountFragment: import("gql.tada").Tad
|
|
|
15
15
|
masked: true;
|
|
16
16
|
}>;
|
|
17
17
|
/** Account-details form after `quoteAccountSignup` has created an account; saves via `contactUpdate` + `accountUpdate` on blur. */
|
|
18
|
-
export default function ExistingAccountForm({ title, className, account: maskedAccount, extraFieldsToShow,
|
|
18
|
+
export default function ExistingAccountForm({ title, className, account: maskedAccount, extraFieldsToShow, priceList, onSelfServiceBuyDisabled, }: {
|
|
19
19
|
title: string;
|
|
20
20
|
className?: string;
|
|
21
21
|
account: FragmentOf<typeof ExistingAccountForm_AccountFragment> | undefined | null;
|
|
22
22
|
extraFieldsToShow?: ExtraSignupFormField[];
|
|
23
|
-
requiredBillingDetails?: RequiredBillingDetailsFlags;
|
|
24
|
-
defaultFormValues?: DefaultSignupValues;
|
|
25
23
|
priceList?: ResultOf<typeof Signup_PriceListFragment> | null;
|
|
26
24
|
onSelfServiceBuyDisabled: () => void;
|
|
27
25
|
}): import("react").JSX.Element;
|
package/dist/cjs/types/src/components/Signup/components/SignupForm/components/NewAccountForm.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { ExtraSignupFormField
|
|
2
|
-
export default function NewAccountForm({ className, extraFieldsToShow,
|
|
1
|
+
import { ExtraSignupFormField } from '../../InitialSignupFormFields';
|
|
2
|
+
export default function NewAccountForm({ className, extraFieldsToShow, title, }: {
|
|
3
3
|
className?: string;
|
|
4
4
|
extraFieldsToShow?: ExtraSignupFormField[];
|
|
5
|
-
requiredBillingDetails?: RequiredBillingDetailsFlags;
|
|
6
|
-
defaultFormValues?: DefaultSignupValues;
|
|
7
5
|
title: string;
|
|
8
6
|
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import type { DefaultSignupValues, RequiredBillingDetailsFlags } from '../components/InitialSignupFormFields';
|
|
3
|
+
/** Fields that can be disabled. Same keys as `DefaultSignupValues`. */
|
|
4
|
+
export type DisabledSignupFields = Partial<Record<keyof DefaultSignupValues, boolean>>;
|
|
5
|
+
/**
|
|
6
|
+
* Customer-facing form configuration for the Signup component.
|
|
7
|
+
* All options are optional. Add new form options here rather than as new props on Signup.
|
|
8
|
+
*/
|
|
9
|
+
export type SignupFormOptions = {
|
|
10
|
+
/** The default form values to use for the signup */
|
|
11
|
+
defaultValues?: DefaultSignupValues;
|
|
12
|
+
/** Which account billing fields to show and require */
|
|
13
|
+
requiredBillingDetails?: RequiredBillingDetailsFlags;
|
|
14
|
+
/**
|
|
15
|
+
* Fields the user cannot edit. Provide a default value for each disabled field:
|
|
16
|
+
* all fields are required, so an empty disabled field blocks the signup.
|
|
17
|
+
*/
|
|
18
|
+
disabledFields?: DisabledSignupFields;
|
|
19
|
+
};
|
|
20
|
+
export declare const SignupFormOptionsProvider: ({ formOptions, children, }: {
|
|
21
|
+
formOptions?: SignupFormOptions;
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
}) => import("react").JSX.Element;
|
|
24
|
+
export declare const useSignupFormOptions: () => SignupFormOptions;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
export { default as Signup } from "./Signup";
|
|
2
|
+
export type { SignupProps } from "./Signup";
|
|
2
3
|
export type { SignupCallbacks } from "./contexts/SignupCallbacksContext";
|
|
4
|
+
export type { DisabledSignupFields, SignupFormOptions } from "./contexts/SignupFormOptionsContext";
|
|
5
|
+
export type { DefaultSignupValues, RequiredBillingDetailsFlags, } from "./components/InitialSignupFormFields";
|
|
@@ -4,6 +4,7 @@ export { Quote } from './Quote';
|
|
|
4
4
|
export { Quotes } from './tables/Quotes';
|
|
5
5
|
export { PaymentForm } from './PaymentForm';
|
|
6
6
|
export { Signup } from './Signup';
|
|
7
|
+
export type { DefaultSignupValues, DisabledSignupFields, RequiredBillingDetailsFlags, SignupCallbacks, SignupFormOptions, SignupProps, } from './Signup';
|
|
7
8
|
export { default as BunnyProvider } from './BunnyProvider/BunnyProvider';
|
|
8
9
|
export { default as Transactions } from './tables/Transactions';
|
|
9
10
|
export { Subscriptions } from './Subscriptions';
|