@bunnyapp/components 1.0.16 → 1.0.18

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.
@@ -1,15 +1,10 @@
1
1
  import "../../styles/index.less";
2
2
  import { ShadowType } from "../../types/shadowType";
3
- declare const BillingDetails: ({ entityId, isCardEnabled, shadow, className, accountId: accountIdProp, hidePaymentMethodForm, countryListFilter, }: {
3
+ declare const BillingDetails: ({ entityId, accountId, isCardEnabled, shadow, className, }: {
4
4
  entityId: string;
5
+ accountId: string;
5
6
  isCardEnabled?: boolean | undefined;
6
7
  shadow?: ShadowType | undefined;
7
8
  className?: string | undefined;
8
- accountId?: string | undefined;
9
- hidePaymentMethodForm?: boolean | undefined;
10
- countryListFilter?: ((country: {
11
- value: string;
12
- label: string;
13
- }) => boolean) | undefined;
14
9
  }) => import("react/jsx-runtime").JSX.Element;
15
10
  export default BillingDetails;
@@ -1,11 +1,10 @@
1
- import { FormattedInvoice, PaymentMethod, PluginData, Quote } from "@bunnyapp/common";
2
- export declare function usePay({ onPaymentSuccess, onPaymentError, quote, invoice, storedPaymentMethod, plugin, }: {
1
+ import { FormattedInvoice, PaymentMethod, Quote } from "@bunnyapp/common";
2
+ export declare function usePay({ onPaymentSuccess, onPaymentError, quote, invoice, storedPaymentMethod, }: {
3
3
  onPaymentSuccess: (response: any) => void;
4
4
  onPaymentError?: (error: any) => void;
5
5
  quote?: Quote;
6
6
  invoice?: FormattedInvoice;
7
7
  storedPaymentMethod?: PaymentMethod;
8
- plugin: PluginData | undefined;
9
8
  }): {
10
9
  pay: () => Promise<void>;
11
10
  };
@@ -1,6 +1,6 @@
1
- import { FormattedInvoice, PluginData, Quote } from "@bunnyapp/common";
1
+ import { FormattedInvoice, Quote } from "@bunnyapp/common";
2
2
  import { GraphQLClient } from "graphql-request";
3
- export declare const PaymentForm: ({ entityId, invoice, onFail, onPaymentSuccess, quote, accountId, onSavePaymentMethod, overrideToken, graphQLClient, customCheckoutFunction, }: {
3
+ export declare const PaymentForm: ({ entityId, invoice, onFail, onPaymentSuccess, quote, accountId, onSavePaymentMethod, overrideToken, graphQLClient, }: {
4
4
  entityId: string;
5
5
  invoice?: FormattedInvoice | undefined;
6
6
  quote?: Quote | undefined;
@@ -10,5 +10,4 @@ export declare const PaymentForm: ({ entityId, invoice, onFail, onPaymentSuccess
10
10
  accountId?: string | undefined;
11
11
  overrideToken?: string | undefined;
12
12
  graphQLClient: GraphQLClient;
13
- customCheckoutFunction?: ((plugin: PluginData | undefined) => Promise<any>) | undefined;
14
13
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,10 @@
1
- import { FormattedInvoice, PaymentMethod, PluginData, Quote } from "@bunnyapp/common";
2
- export declare function usePay({ onPaymentSuccess, onPaymentError, quote, invoice, storedPaymentMethod, plugin, }: {
1
+ import { FormattedInvoice, PaymentMethod, Quote } from "@bunnyapp/common";
2
+ export declare function usePay({ onPaymentSuccess, onPaymentError, quote, invoice, storedPaymentMethod, }: {
3
3
  onPaymentSuccess?: (response: any) => void;
4
4
  onPaymentError?: (error: any) => void;
5
5
  quote?: Quote;
6
6
  invoice?: FormattedInvoice;
7
7
  storedPaymentMethod?: PaymentMethod;
8
- plugin: PluginData | undefined;
9
8
  }): {
10
9
  pay: () => Promise<void>;
11
10
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Meta, StoryObj } from "@storybook/react";
3
2
  import Quote from "./Quote";
4
3
  declare const meta: Meta<typeof Quote>;
@@ -16,16 +15,16 @@ export declare const Default: import("@storybook/csf").StoryAnnotations<import("
16
15
  className?: string | undefined;
17
16
  hideDownloadButton?: boolean | undefined;
18
17
  }, {
19
- id?: string | undefined;
20
- entityId?: string | undefined;
21
18
  backButtonName?: string | undefined;
22
19
  onBackButtonClick?: (() => void) | undefined;
23
20
  shadow?: import("../../types/shadowType").ShadowType | undefined;
24
21
  hideDownloadButton?: boolean | undefined;
22
+ id?: string | undefined;
25
23
  className?: string | undefined;
26
- onPaymentSuccess?: ((savePaymentMethod?: boolean | undefined) => void) | undefined;
27
24
  invoiceQuoteViewComponent?: import("react").ReactNode;
28
25
  onInvoiceDownloadError?: (() => void) | undefined;
26
+ onPaymentSuccess?: ((savePaymentMethod?: boolean | undefined) => void) | undefined;
27
+ entityId?: string | undefined;
29
28
  }>;
30
29
  export declare const NoShadow: import("@storybook/csf").StoryAnnotations<import("@storybook/react/dist/types-a5624094").R, {
31
30
  id?: string | undefined;
@@ -39,16 +38,16 @@ export declare const NoShadow: import("@storybook/csf").StoryAnnotations<import(
39
38
  className?: string | undefined;
40
39
  hideDownloadButton?: boolean | undefined;
41
40
  }, {
42
- id?: string | undefined;
43
- entityId?: string | undefined;
44
41
  backButtonName?: string | undefined;
45
42
  onBackButtonClick?: (() => void) | undefined;
46
43
  shadow?: import("../../types/shadowType").ShadowType | undefined;
47
44
  hideDownloadButton?: boolean | undefined;
45
+ id?: string | undefined;
48
46
  className?: string | undefined;
49
- onPaymentSuccess?: ((savePaymentMethod?: boolean | undefined) => void) | undefined;
50
47
  invoiceQuoteViewComponent?: import("react").ReactNode;
51
48
  onInvoiceDownloadError?: (() => void) | undefined;
49
+ onPaymentSuccess?: ((savePaymentMethod?: boolean | undefined) => void) | undefined;
50
+ entityId?: string | undefined;
52
51
  }>;
53
52
  export declare const Mobile: import("@storybook/csf").StoryAnnotations<import("@storybook/react/dist/types-a5624094").R, {
54
53
  id?: string | undefined;
@@ -62,16 +61,16 @@ export declare const Mobile: import("@storybook/csf").StoryAnnotations<import("@
62
61
  className?: string | undefined;
63
62
  hideDownloadButton?: boolean | undefined;
64
63
  }, {
65
- id?: string | undefined;
66
- entityId?: string | undefined;
67
64
  backButtonName?: string | undefined;
68
65
  onBackButtonClick?: (() => void) | undefined;
69
66
  shadow?: import("../../types/shadowType").ShadowType | undefined;
70
67
  hideDownloadButton?: boolean | undefined;
68
+ id?: string | undefined;
71
69
  className?: string | undefined;
72
- onPaymentSuccess?: ((savePaymentMethod?: boolean | undefined) => void) | undefined;
73
70
  invoiceQuoteViewComponent?: import("react").ReactNode;
74
71
  onInvoiceDownloadError?: (() => void) | undefined;
72
+ onPaymentSuccess?: ((savePaymentMethod?: boolean | undefined) => void) | undefined;
73
+ entityId?: string | undefined;
75
74
  }>;
76
75
  export declare const CustomClassName: import("@storybook/csf").StoryAnnotations<import("@storybook/react/dist/types-a5624094").R, {
77
76
  id?: string | undefined;
@@ -85,16 +84,16 @@ export declare const CustomClassName: import("@storybook/csf").StoryAnnotations<
85
84
  className?: string | undefined;
86
85
  hideDownloadButton?: boolean | undefined;
87
86
  }, {
88
- id?: string | undefined;
89
- entityId?: string | undefined;
90
87
  backButtonName?: string | undefined;
91
88
  onBackButtonClick?: (() => void) | undefined;
92
89
  shadow?: import("../../types/shadowType").ShadowType | undefined;
93
90
  hideDownloadButton?: boolean | undefined;
91
+ id?: string | undefined;
94
92
  className?: string | undefined;
95
- onPaymentSuccess?: ((savePaymentMethod?: boolean | undefined) => void) | undefined;
96
93
  invoiceQuoteViewComponent?: import("react").ReactNode;
97
94
  onInvoiceDownloadError?: (() => void) | undefined;
95
+ onPaymentSuccess?: ((savePaymentMethod?: boolean | undefined) => void) | undefined;
96
+ entityId?: string | undefined;
98
97
  }>;
99
98
  export declare const HideDownloadButton: Story;
100
99
  export declare const AcceptedQuote: Story;
@@ -111,14 +110,14 @@ export declare const DarkMode: import("@storybook/csf").StoryAnnotations<import(
111
110
  className?: string | undefined;
112
111
  hideDownloadButton?: boolean | undefined;
113
112
  }, {
114
- id?: string | undefined;
115
- entityId?: string | undefined;
116
113
  backButtonName?: string | undefined;
117
114
  onBackButtonClick?: (() => void) | undefined;
118
115
  shadow?: import("../../types/shadowType").ShadowType | undefined;
119
116
  hideDownloadButton?: boolean | undefined;
117
+ id?: string | undefined;
120
118
  className?: string | undefined;
121
- onPaymentSuccess?: ((savePaymentMethod?: boolean | undefined) => void) | undefined;
122
119
  invoiceQuoteViewComponent?: import("react").ReactNode;
123
120
  onInvoiceDownloadError?: (() => void) | undefined;
121
+ onPaymentSuccess?: ((savePaymentMethod?: boolean | undefined) => void) | undefined;
122
+ entityId?: string | undefined;
124
123
  }>;
@@ -1,14 +1,13 @@
1
- import { PluginData, Quote } from "@bunnyapp/common";
2
- export default function PaymentForms({ quote, handlePaymentSuccess, handlePaymentFail, handleSubmit, proceedingToPayment, entityId, accountId, overrideToken, customCheckoutFunction, }: {
1
+ import { Quote } from "@bunnyapp/common";
2
+ export default function PaymentForms({ quote, handlePaymentSaveSuccess, handlePaymentFail, handleSubmit, proceedingToPayment, entityId, accountId, overrideToken, }: {
3
3
  quote?: Quote;
4
- handlePaymentSuccess: () => void;
4
+ handlePaymentSaveSuccess: () => void;
5
5
  handlePaymentFail: (error: any) => void;
6
6
  handleSubmit: (formData: FormData) => void;
7
7
  proceedingToPayment: boolean;
8
8
  entityId: string;
9
9
  accountId?: string;
10
10
  overrideToken?: string;
11
- customCheckoutFunction?: (plugin: PluginData | undefined) => Promise<any>;
12
11
  }): import("react/jsx-runtime").JSX.Element;
13
12
  export type FormData = {
14
13
  firstName: string;
@@ -1,7 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import "../../styles/index.less";
3
3
  import { ShadowType } from "../../types/shadowType";
4
- export default function Signup({ companyName, entityId, priceListCode, returnUrl, isCardEnabled, className, shadow, style, }: {
4
+ export default function Signup({ apiToken, companyName, entityId, priceListCode, returnUrl, isCardEnabled, className, shadow, style, }: {
5
+ /** The API token to use for the signup. Signup needs a Bunny api client token, not a portalSessionToken. */
6
+ apiToken: string;
5
7
  /** The company name to display on the signup page */
6
8
  companyName: string;
7
9
  /** The entity ID to use for the signup */
@@ -1,10 +1,9 @@
1
1
  /// <reference types="react" />
2
- import { PaymentMethod, PluginData } from "@bunnyapp/common";
2
+ import { PaymentMethod } from "@bunnyapp/common";
3
3
  export type PaymentContextValues = {
4
4
  onClickCancel?: () => void;
5
5
  accountId?: string;
6
6
  overrideToken?: string;
7
7
  storedPaymentMethod?: PaymentMethod;
8
- customCheckoutFunction?: (plugin: PluginData | undefined) => Promise<any>;
9
8
  };
10
9
  export declare const PaymentContext: import("react").Context<PaymentContextValues>;
@@ -1,2 +1,2 @@
1
1
  import { GraphQLClient } from "graphql-request";
2
- export declare const usePaymentMethod: (graphQLClient: GraphQLClient) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<any, Error>;
2
+ export declare const usePaymentMethod: (graphQLClient: GraphQLClient, accountId?: string) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<any, Error>;