@bunnyapp/components 1.0.13 → 1.0.14
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 +15966 -153
- package/dist/cjs/src/components/BunnyProvider.d.ts +3 -5
- package/dist/cjs/src/components/Invoice/Invoice.d.ts +1 -15
- package/dist/cjs/src/components/Invoice/InvoiceQuoteContext.d.ts +15 -0
- package/dist/cjs/src/components/PaymentForm/PaymentForm.d.ts +4 -1
- package/dist/cjs/src/components/Quote/Quote.d.ts +1 -1
- package/dist/cjs/src/components/Quote/Quote.stories.d.ts +25 -25
- package/dist/cjs/src/components/Quotes/Quotes.d.ts +5 -1
- package/dist/cjs/src/components/Signup/PaymentForms.d.ts +2 -1
- package/dist/cjs/src/components/Signup/Signup.d.ts +7 -1
- package/dist/cjs/src/components/Subscriptions/Subscriptions.d.ts +0 -10
- package/dist/cjs/src/components/Subscriptions/SubscriptionsContext.d.ts +10 -0
- package/dist/cjs/src/components/Transactions/Transactions.d.ts +11 -2
- package/dist/cjs/src/components/Transactions/TransactionsListContext.d.ts +3 -1
- package/dist/cjs/src/components/Transactions/transactionsList/TransactionsListDesktop.d.ts +1 -1
- package/dist/cjs/src/components/index.d.ts +1 -0
- package/dist/cjs/src/contexts/PaymentContext.d.ts +1 -0
- package/dist/cjs/src/graphql/graphqlUtil.d.ts +10 -0
- package/dist/cjs/src/graphql/queries/getTransactions.d.ts +2 -2
- package/dist/esm/index.js +16057 -246
- package/dist/esm/src/components/BunnyProvider.d.ts +3 -5
- package/dist/esm/src/components/Invoice/Invoice.d.ts +1 -15
- package/dist/esm/src/components/Invoice/InvoiceQuoteContext.d.ts +15 -0
- package/dist/esm/src/components/PaymentForm/PaymentForm.d.ts +4 -1
- package/dist/esm/src/components/Quote/Quote.d.ts +1 -1
- package/dist/esm/src/components/Quote/Quote.stories.d.ts +25 -25
- package/dist/esm/src/components/Quotes/Quotes.d.ts +5 -1
- package/dist/esm/src/components/Signup/PaymentForms.d.ts +2 -1
- package/dist/esm/src/components/Signup/Signup.d.ts +7 -1
- package/dist/esm/src/components/Subscriptions/Subscriptions.d.ts +0 -10
- package/dist/esm/src/components/Subscriptions/SubscriptionsContext.d.ts +10 -0
- package/dist/esm/src/components/Transactions/Transactions.d.ts +11 -2
- package/dist/esm/src/components/Transactions/TransactionsListContext.d.ts +3 -1
- package/dist/esm/src/components/Transactions/transactionsList/TransactionsListDesktop.d.ts +1 -1
- package/dist/esm/src/components/index.d.ts +1 -0
- package/dist/esm/src/contexts/PaymentContext.d.ts +1 -0
- package/dist/esm/src/graphql/graphqlUtil.d.ts +10 -0
- package/dist/esm/src/graphql/queries/getTransactions.d.ts +2 -2
- package/dist/index.d.ts +40 -12
- package/package.json +1 -1
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { QueryClient } from "@tanstack/react-query";
|
|
3
|
+
import { ThemeConfig } from "antd";
|
|
3
4
|
import { GraphQLClient } from "graphql-request";
|
|
4
5
|
export type BunnyContextValues = {
|
|
5
6
|
apiHost: string;
|
|
6
7
|
graphQLClient: GraphQLClient;
|
|
7
|
-
window: Window;
|
|
8
8
|
token: string;
|
|
9
|
-
accountId?: string;
|
|
10
9
|
displayPayButtonNameAnyways?: boolean;
|
|
11
10
|
darkMode?: boolean;
|
|
12
11
|
onTokenExpired?: () => void;
|
|
13
12
|
};
|
|
14
13
|
export declare const BunnyContext: import("react").Context<BunnyContextValues>;
|
|
15
|
-
declare function BunnyProvider({
|
|
16
|
-
accountId?: string;
|
|
14
|
+
declare function BunnyProvider({ children, darkMode, queryClient, apiHost, token, onTokenExpired, configProviderProps, }: {
|
|
17
15
|
children: React.ReactNode;
|
|
18
16
|
darkMode?: boolean;
|
|
19
17
|
queryClient?: QueryClient;
|
|
20
18
|
apiHost: string;
|
|
21
19
|
token: string;
|
|
22
|
-
window: Window;
|
|
23
20
|
onTokenExpired?: () => void;
|
|
21
|
+
configProviderProps?: ThemeConfig | undefined;
|
|
24
22
|
}): import("react/jsx-runtime").JSX.Element;
|
|
25
23
|
export default BunnyProvider;
|
|
@@ -1,16 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ShadowType } from "../../types/shadowType";
|
|
3
|
-
export type InvoiceQuoteContextProps = {
|
|
4
|
-
id?: string;
|
|
5
|
-
invoiceQuoteViewComponent?: React.ReactNode;
|
|
6
|
-
backButtonName?: string;
|
|
7
|
-
onBackButtonClick?: () => void;
|
|
8
|
-
onInvoiceDownloadError?: () => void;
|
|
9
|
-
onPaymentSuccess?: (savePaymentMethod?: boolean) => void;
|
|
10
|
-
entityId: string;
|
|
11
|
-
shadow?: ShadowType;
|
|
12
|
-
className?: string;
|
|
13
|
-
hideDownloadButton?: boolean;
|
|
14
|
-
};
|
|
15
|
-
export declare const InvoiceQuoteContext: React.Context<InvoiceQuoteContextProps>;
|
|
1
|
+
import { InvoiceQuoteContextProps } from "./InvoiceQuoteContext";
|
|
16
2
|
export default function Invoice({ id, invoiceQuoteViewComponent, backButtonName, onBackButtonClick, onInvoiceDownloadError, onPaymentSuccess, entityId, shadow, className, hideDownloadButton, }: InvoiceQuoteContextProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ShadowType } from "../../types/shadowType";
|
|
3
|
+
export type InvoiceQuoteContextProps = {
|
|
4
|
+
id?: string;
|
|
5
|
+
invoiceQuoteViewComponent?: React.ReactNode;
|
|
6
|
+
backButtonName?: string;
|
|
7
|
+
onBackButtonClick?: () => void;
|
|
8
|
+
onInvoiceDownloadError?: () => void;
|
|
9
|
+
onPaymentSuccess?: (savePaymentMethod?: boolean) => void;
|
|
10
|
+
entityId: string;
|
|
11
|
+
shadow?: ShadowType;
|
|
12
|
+
className?: string;
|
|
13
|
+
hideDownloadButton?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare const InvoiceQuoteContext: import("react").Context<InvoiceQuoteContextProps>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FormattedInvoice, Quote } from "@bunnyapp/common";
|
|
2
2
|
import { OnPaymentSuccessType } from "./PaymentFormTypes";
|
|
3
|
-
|
|
3
|
+
import { GraphQLClient } from "graphql-request";
|
|
4
|
+
export declare const PaymentForm: ({ entityId, invoice, onFail, onPaymentSuccess, quote, accountId, onSavePaymentMethod, overrideToken, graphQLClient, }: {
|
|
4
5
|
entityId: string;
|
|
5
6
|
invoice?: FormattedInvoice | undefined;
|
|
6
7
|
quote?: Quote | undefined;
|
|
@@ -8,4 +9,6 @@ export declare const PaymentForm: ({ entityId, invoice, onFail, onPaymentSuccess
|
|
|
8
9
|
onPaymentSuccess?: (({ pluginPaymentResponse, savedPaymentMethodResponse, }: OnPaymentSuccessType) => void) | undefined;
|
|
9
10
|
onSavePaymentMethod?: (() => void) | undefined;
|
|
10
11
|
accountId?: string | undefined;
|
|
12
|
+
overrideToken?: string | undefined;
|
|
13
|
+
graphQLClient: GraphQLClient;
|
|
11
14
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { InvoiceQuoteContextProps } from "../Invoice/
|
|
2
|
+
import { InvoiceQuoteContextProps } from "../Invoice/InvoiceQuoteContext";
|
|
3
3
|
export declare const MarkupContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
4
4
|
export default function Quote({ id, invoiceQuoteViewComponent, onInvoiceDownloadError, onPaymentSuccess, entityId, shadow, className, hideDownloadButton, }: InvoiceQuoteContextProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -18,14 +18,14 @@ export declare const Default: import("@storybook/csf").StoryAnnotations<import("
|
|
|
18
18
|
}, {
|
|
19
19
|
id?: string | undefined;
|
|
20
20
|
entityId?: string | undefined;
|
|
21
|
+
backButtonName?: string | undefined;
|
|
22
|
+
onBackButtonClick?: (() => void) | undefined;
|
|
23
|
+
shadow?: import("../../types/shadowType").ShadowType | undefined;
|
|
24
|
+
hideDownloadButton?: boolean | undefined;
|
|
21
25
|
className?: string | undefined;
|
|
26
|
+
onPaymentSuccess?: ((savePaymentMethod?: boolean | undefined) => void) | undefined;
|
|
22
27
|
invoiceQuoteViewComponent?: import("react").ReactNode;
|
|
23
28
|
onInvoiceDownloadError?: (() => void) | undefined;
|
|
24
|
-
onPaymentSuccess?: ((savePaymentMethod?: boolean | undefined) => void) | undefined;
|
|
25
|
-
shadow?: import("../../types/shadowType").ShadowType | undefined;
|
|
26
|
-
hideDownloadButton?: boolean | undefined;
|
|
27
|
-
backButtonName?: string | undefined;
|
|
28
|
-
onBackButtonClick?: (() => void) | undefined;
|
|
29
29
|
}>;
|
|
30
30
|
export declare const NoShadow: import("@storybook/csf").StoryAnnotations<import("@storybook/react/dist/types-a5624094").R, {
|
|
31
31
|
id?: string | undefined;
|
|
@@ -41,14 +41,14 @@ export declare const NoShadow: import("@storybook/csf").StoryAnnotations<import(
|
|
|
41
41
|
}, {
|
|
42
42
|
id?: string | undefined;
|
|
43
43
|
entityId?: string | undefined;
|
|
44
|
+
backButtonName?: string | undefined;
|
|
45
|
+
onBackButtonClick?: (() => void) | undefined;
|
|
46
|
+
shadow?: import("../../types/shadowType").ShadowType | undefined;
|
|
47
|
+
hideDownloadButton?: boolean | undefined;
|
|
44
48
|
className?: string | undefined;
|
|
49
|
+
onPaymentSuccess?: ((savePaymentMethod?: boolean | undefined) => void) | undefined;
|
|
45
50
|
invoiceQuoteViewComponent?: import("react").ReactNode;
|
|
46
51
|
onInvoiceDownloadError?: (() => void) | undefined;
|
|
47
|
-
onPaymentSuccess?: ((savePaymentMethod?: boolean | undefined) => void) | undefined;
|
|
48
|
-
shadow?: import("../../types/shadowType").ShadowType | undefined;
|
|
49
|
-
hideDownloadButton?: boolean | undefined;
|
|
50
|
-
backButtonName?: string | undefined;
|
|
51
|
-
onBackButtonClick?: (() => void) | undefined;
|
|
52
52
|
}>;
|
|
53
53
|
export declare const Mobile: import("@storybook/csf").StoryAnnotations<import("@storybook/react/dist/types-a5624094").R, {
|
|
54
54
|
id?: string | undefined;
|
|
@@ -64,14 +64,14 @@ export declare const Mobile: import("@storybook/csf").StoryAnnotations<import("@
|
|
|
64
64
|
}, {
|
|
65
65
|
id?: string | undefined;
|
|
66
66
|
entityId?: string | undefined;
|
|
67
|
+
backButtonName?: string | undefined;
|
|
68
|
+
onBackButtonClick?: (() => void) | undefined;
|
|
69
|
+
shadow?: import("../../types/shadowType").ShadowType | undefined;
|
|
70
|
+
hideDownloadButton?: boolean | undefined;
|
|
67
71
|
className?: string | undefined;
|
|
72
|
+
onPaymentSuccess?: ((savePaymentMethod?: boolean | undefined) => void) | undefined;
|
|
68
73
|
invoiceQuoteViewComponent?: import("react").ReactNode;
|
|
69
74
|
onInvoiceDownloadError?: (() => void) | undefined;
|
|
70
|
-
onPaymentSuccess?: ((savePaymentMethod?: boolean | undefined) => void) | undefined;
|
|
71
|
-
shadow?: import("../../types/shadowType").ShadowType | undefined;
|
|
72
|
-
hideDownloadButton?: boolean | undefined;
|
|
73
|
-
backButtonName?: string | undefined;
|
|
74
|
-
onBackButtonClick?: (() => void) | undefined;
|
|
75
75
|
}>;
|
|
76
76
|
export declare const CustomClassName: import("@storybook/csf").StoryAnnotations<import("@storybook/react/dist/types-a5624094").R, {
|
|
77
77
|
id?: string | undefined;
|
|
@@ -87,14 +87,14 @@ export declare const CustomClassName: import("@storybook/csf").StoryAnnotations<
|
|
|
87
87
|
}, {
|
|
88
88
|
id?: string | undefined;
|
|
89
89
|
entityId?: string | undefined;
|
|
90
|
+
backButtonName?: string | undefined;
|
|
91
|
+
onBackButtonClick?: (() => void) | undefined;
|
|
92
|
+
shadow?: import("../../types/shadowType").ShadowType | undefined;
|
|
93
|
+
hideDownloadButton?: boolean | undefined;
|
|
90
94
|
className?: string | undefined;
|
|
95
|
+
onPaymentSuccess?: ((savePaymentMethod?: boolean | undefined) => void) | undefined;
|
|
91
96
|
invoiceQuoteViewComponent?: import("react").ReactNode;
|
|
92
97
|
onInvoiceDownloadError?: (() => void) | undefined;
|
|
93
|
-
onPaymentSuccess?: ((savePaymentMethod?: boolean | undefined) => void) | undefined;
|
|
94
|
-
shadow?: import("../../types/shadowType").ShadowType | undefined;
|
|
95
|
-
hideDownloadButton?: boolean | undefined;
|
|
96
|
-
backButtonName?: string | undefined;
|
|
97
|
-
onBackButtonClick?: (() => void) | undefined;
|
|
98
98
|
}>;
|
|
99
99
|
export declare const HideDownloadButton: Story;
|
|
100
100
|
export declare const AcceptedQuote: Story;
|
|
@@ -113,12 +113,12 @@ export declare const DarkMode: import("@storybook/csf").StoryAnnotations<import(
|
|
|
113
113
|
}, {
|
|
114
114
|
id?: string | undefined;
|
|
115
115
|
entityId?: string | undefined;
|
|
116
|
+
backButtonName?: string | undefined;
|
|
117
|
+
onBackButtonClick?: (() => void) | undefined;
|
|
118
|
+
shadow?: import("../../types/shadowType").ShadowType | undefined;
|
|
119
|
+
hideDownloadButton?: boolean | undefined;
|
|
116
120
|
className?: string | undefined;
|
|
121
|
+
onPaymentSuccess?: ((savePaymentMethod?: boolean | undefined) => void) | undefined;
|
|
117
122
|
invoiceQuoteViewComponent?: import("react").ReactNode;
|
|
118
123
|
onInvoiceDownloadError?: (() => void) | undefined;
|
|
119
|
-
onPaymentSuccess?: ((savePaymentMethod?: boolean | undefined) => void) | undefined;
|
|
120
|
-
shadow?: import("../../types/shadowType").ShadowType | undefined;
|
|
121
|
-
hideDownloadButton?: boolean | undefined;
|
|
122
|
-
backButtonName?: string | undefined;
|
|
123
|
-
onBackButtonClick?: (() => void) | undefined;
|
|
124
124
|
}>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { FrontendTransaction as T } from "@bunnyapp/common";
|
|
3
3
|
import { ShadowType } from "../../types/shadowType";
|
|
4
4
|
import { TransactionListColumnType } from "../Transactions/transactionsList/TransactionsListDesktop";
|
|
5
|
-
declare function Quotes({ className, columns, entityId, filter, noQuotesMessage, onQuoteClick, quoteComponent, searchBarClassName, shadow, showSearchBar, showTitle, title, style, suppressQuoteDisplay, useModal, }: {
|
|
5
|
+
declare function Quotes({ className, columns, entityId, filter, filterQuotes, sort, noQuotesMessage, onQuoteClick, quoteComponent, searchBarClassName, shadow, showSearchBar, showTitle, title, style, suppressQuoteDisplay, useModal, }: {
|
|
6
6
|
/** A custom component to render instead of the default invoice component */
|
|
7
7
|
quoteComponent?: React.ReactNode;
|
|
8
8
|
/** Whether to show the search bar */
|
|
@@ -29,6 +29,10 @@ declare function Quotes({ className, columns, entityId, filter, noQuotesMessage,
|
|
|
29
29
|
style?: React.CSSProperties;
|
|
30
30
|
/** A filter to apply to the quotes. Docs on filter: https://docs.bunny.com/developer/getting-started/using-filters-in-queries */
|
|
31
31
|
filter?: string;
|
|
32
|
+
/** A function to filter the quotes. Runs on the client side. */
|
|
33
|
+
filterQuotes?: (quote: T.Transaction) => boolean;
|
|
34
|
+
/** A function to sort the quotes. Runs on the client side. */
|
|
35
|
+
sort?: (a: T.Transaction, b: T.Transaction) => number;
|
|
32
36
|
/** Message to display when there are no quotes */
|
|
33
37
|
noQuotesMessage?: string;
|
|
34
38
|
entityId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Quote } from "@bunnyapp/common";
|
|
2
2
|
import { OnPaymentSuccessType } from "../PaymentForm/PaymentFormTypes";
|
|
3
|
-
export default function PaymentForms({ quote, handlePaymentSaveSuccess, handlePaymentFail, handleSubmit, proceedingToPayment, entityId, accountId, }: {
|
|
3
|
+
export default function PaymentForms({ quote, handlePaymentSaveSuccess, handlePaymentFail, handleSubmit, proceedingToPayment, entityId, accountId, overrideToken, }: {
|
|
4
4
|
quote?: Quote;
|
|
5
5
|
handlePaymentSaveSuccess: (paymentSuccess: OnPaymentSuccessType) => void;
|
|
6
6
|
handlePaymentFail: (error: any) => void;
|
|
@@ -8,6 +8,7 @@ export default function PaymentForms({ quote, handlePaymentSaveSuccess, handlePa
|
|
|
8
8
|
proceedingToPayment: boolean;
|
|
9
9
|
entityId: string;
|
|
10
10
|
accountId?: string;
|
|
11
|
+
overrideToken?: string;
|
|
11
12
|
}): import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export type FormData = {
|
|
13
14
|
firstName: string;
|
|
@@ -1,10 +1,16 @@
|
|
|
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;
|
|
7
|
+
/** The company name to display on the signup page */
|
|
5
8
|
companyName: string;
|
|
9
|
+
/** The entity ID to use for the signup */
|
|
6
10
|
entityId: string;
|
|
11
|
+
/** The price list code to use for the signup */
|
|
7
12
|
priceListCode: string;
|
|
13
|
+
/** The return URL to that customers can be redirected to after signup */
|
|
8
14
|
returnUrl?: string;
|
|
9
15
|
/** Whether or not to display signup within a card */
|
|
10
16
|
isCardEnabled?: boolean;
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import "../../styles/index.less";
|
|
3
|
-
export type SubscriptionsContextValues = {
|
|
4
|
-
onChangePlanClick: () => void;
|
|
5
|
-
onClickUpgrade: () => void;
|
|
6
|
-
isTempViewOnly: boolean;
|
|
7
|
-
shadow?: "none" | "sm" | "md" | "lg";
|
|
8
|
-
gap?: number;
|
|
9
|
-
showTitle?: boolean;
|
|
10
|
-
};
|
|
11
|
-
export declare const SubscriptionsContext: import("react").Context<SubscriptionsContextValues>;
|
|
12
2
|
export type EditingQuoteDataType = {
|
|
13
3
|
id: string;
|
|
14
4
|
isTrial: boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type SubscriptionsContextValues = {
|
|
3
|
+
onChangePlanClick: () => void;
|
|
4
|
+
onClickUpgrade: () => void;
|
|
5
|
+
isTempViewOnly: boolean;
|
|
6
|
+
shadow?: "none" | "sm" | "md" | "lg";
|
|
7
|
+
gap?: number;
|
|
8
|
+
showTitle?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const SubscriptionsContext: import("react").Context<SubscriptionsContextValues>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FrontendTransaction as T, TransactionKind } from "@bunnyapp/common";
|
|
3
3
|
import { ShadowType } from "../../types/shadowType";
|
|
4
|
-
export default function Transactions({ transactionComponent, showSearchBar, showTitle, title, columns, className, shadow, searchBarClassName, useModal, onTransactionClick, suppressTransactionDisplay, kindsToShow, style, filter, noTransactionsMessage, entityId, }: {
|
|
4
|
+
export default function Transactions({ transactionComponent, showSearchBar, showTitle, title, columns, className, shadow, searchBarClassName, useModal, onTransactionClick, suppressTransactionDisplay, kindsToShow, style, filter, noTransactionsMessage, entityId, filterTransactions, sortTransactions, }: {
|
|
5
5
|
/** A custom component to render instead of the default invoice component */
|
|
6
6
|
transactionComponent?: React.ReactNode;
|
|
7
7
|
/** Whether to show the search bar */
|
|
@@ -28,12 +28,21 @@ export default function Transactions({ transactionComponent, showSearchBar, show
|
|
|
28
28
|
kindsToShow?: TransactionKind[];
|
|
29
29
|
/** A custom style to apply to the component */
|
|
30
30
|
style?: React.CSSProperties;
|
|
31
|
-
/** A filter to apply to the transactions. Docs on filter: https://docs.bunny.com/developer/getting-started/using-filters-in-queries
|
|
31
|
+
/** A filter to apply to the transactions. Docs on filter: https://docs.bunny.com/developer/getting-started/using-filters-in-queries
|
|
32
|
+
* Filtering is applied on the api side, potentially speeding up the transactions query
|
|
33
|
+
*/
|
|
32
34
|
filter?: string;
|
|
33
35
|
/** Message to display when there are no transactions */
|
|
34
36
|
noTransactionsMessage?: string;
|
|
35
37
|
/** The entity id to pass to the invoice component */
|
|
36
38
|
entityId: string;
|
|
39
|
+
/** A function to filter the transactions
|
|
40
|
+
* Filtering is applied on the client side.
|
|
41
|
+
* This is useful to have more control over the filtering logic.
|
|
42
|
+
*/
|
|
43
|
+
filterTransactions?: (transaction: T.Transaction) => boolean;
|
|
44
|
+
/** A function to sort the transactions. Runs on the client side. */
|
|
45
|
+
sortTransactions?: (transactionA: T.Transaction, transactionB: T.Transaction) => number;
|
|
37
46
|
}): import("react/jsx-runtime").JSX.Element;
|
|
38
47
|
export declare function TransactionsDisplay({ transactions, onSearchValueChanged, search, }: {
|
|
39
48
|
transactions: T.Transaction[];
|
|
@@ -16,11 +16,13 @@ export type TransactionsContextValues = {
|
|
|
16
16
|
onTransactionClick?: (transaction: T.Transaction) => void;
|
|
17
17
|
onTransactionDisplayClose?: (transaction: T.Transaction | null) => void;
|
|
18
18
|
suppressTransactionDisplay?: boolean;
|
|
19
|
-
kindsToShow
|
|
19
|
+
kindsToShow?: TransactionKind[];
|
|
20
20
|
style?: React.CSSProperties;
|
|
21
21
|
filter?: string;
|
|
22
22
|
noTransactionsMessage?: string;
|
|
23
23
|
downloadTransactionLink?: (id: string) => string;
|
|
24
24
|
entityId: string;
|
|
25
|
+
filterTransactions?: (transaction: T.Transaction) => boolean;
|
|
26
|
+
sortTransactions?: (transactionA: T.Transaction, transactionB: T.Transaction) => number;
|
|
25
27
|
};
|
|
26
28
|
export declare const TransactionsListContext: import("react").Context<TransactionsContextValues>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FrontendTransaction as T } from "@bunnyapp/common";
|
|
1
|
+
import { FrontendTransaction as T, Transaction } from "@bunnyapp/common";
|
|
2
2
|
export type TransactionListColumnType = "date-and-title" | "state" | "amount" | "download";
|
|
3
3
|
declare const TransactionsListDesktop: ({ transactions, onTransactionClick, }: {
|
|
4
4
|
transactions: T.Transaction[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type gqlRequestOptions = {
|
|
2
|
+
query: string;
|
|
3
|
+
vars?: Record<string, any>;
|
|
4
|
+
headers?: Record<string, string>;
|
|
5
|
+
token: string;
|
|
6
|
+
isInPreviewMode?: boolean;
|
|
7
|
+
apiHost: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const gqlRequest: ({ query, vars, headers, token, isInPreviewMode, apiHost, }: gqlRequestOptions) => Promise<unknown>;
|
|
10
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const getTransactions: (filter: string, token: string, apiHost: string
|
|
1
|
+
import { FrontendTransaction as T } from "@bunnyapp/common";
|
|
2
|
+
declare const getTransactions: (filter: string, token: string, apiHost: string) => Promise<T.Transaction[]>;
|
|
3
3
|
export default getTransactions;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import React$1 from 'react';
|
|
4
3
|
import { FrontendTransaction, FormattedInvoice, Quote as Quote$1, PriceList, PaymentMethod as PaymentMethod$1, TransactionKind } from '@bunnyapp/common';
|
|
5
4
|
import { QueryClient } from '@tanstack/react-query';
|
|
5
|
+
import { ThemeConfig } from 'antd';
|
|
6
|
+
import react from 'react';
|
|
6
7
|
import * as _tanstack_react_query_build_legacy_types from '@tanstack/react-query/build/legacy/types';
|
|
7
8
|
import { GraphQLClient } from 'graphql-request';
|
|
8
9
|
|
|
@@ -10,7 +11,7 @@ type ShadowType = "shadow-none" | "shadow-sm" | "shadow-md" | "shadow-lg" | "sha
|
|
|
10
11
|
|
|
11
12
|
type InvoiceQuoteContextProps = {
|
|
12
13
|
id?: string;
|
|
13
|
-
invoiceQuoteViewComponent?: React
|
|
14
|
+
invoiceQuoteViewComponent?: React.ReactNode;
|
|
14
15
|
backButtonName?: string;
|
|
15
16
|
onBackButtonClick?: () => void;
|
|
16
17
|
onInvoiceDownloadError?: () => void;
|
|
@@ -20,6 +21,7 @@ type InvoiceQuoteContextProps = {
|
|
|
20
21
|
className?: string;
|
|
21
22
|
hideDownloadButton?: boolean;
|
|
22
23
|
};
|
|
24
|
+
|
|
23
25
|
declare function Invoice({ id, invoiceQuoteViewComponent, backButtonName, onBackButtonClick, onInvoiceDownloadError, onPaymentSuccess, entityId, shadow, className, hideDownloadButton, }: InvoiceQuoteContextProps): react_jsx_runtime.JSX.Element;
|
|
24
26
|
|
|
25
27
|
declare global {
|
|
@@ -34,7 +36,7 @@ declare function Quote({ id, invoiceQuoteViewComponent, onInvoiceDownloadError,
|
|
|
34
36
|
|
|
35
37
|
type TransactionListColumnType = "date-and-title" | "state" | "amount" | "download";
|
|
36
38
|
|
|
37
|
-
declare function Quotes({ className, columns, entityId, filter, noQuotesMessage, onQuoteClick, quoteComponent, searchBarClassName, shadow, showSearchBar, showTitle, title, style, suppressQuoteDisplay, useModal, }: {
|
|
39
|
+
declare function Quotes({ className, columns, entityId, filter, filterQuotes, sort, noQuotesMessage, onQuoteClick, quoteComponent, searchBarClassName, shadow, showSearchBar, showTitle, title, style, suppressQuoteDisplay, useModal, }: {
|
|
38
40
|
/** A custom component to render instead of the default invoice component */
|
|
39
41
|
quoteComponent?: React.ReactNode;
|
|
40
42
|
/** Whether to show the search bar */
|
|
@@ -61,6 +63,10 @@ declare function Quotes({ className, columns, entityId, filter, noQuotesMessage,
|
|
|
61
63
|
style?: React.CSSProperties;
|
|
62
64
|
/** A filter to apply to the quotes. Docs on filter: https://docs.bunny.com/developer/getting-started/using-filters-in-queries */
|
|
63
65
|
filter?: string;
|
|
66
|
+
/** A function to filter the quotes. Runs on the client side. */
|
|
67
|
+
filterQuotes?: (quote: FrontendTransaction.Transaction) => boolean;
|
|
68
|
+
/** A function to sort the quotes. Runs on the client side. */
|
|
69
|
+
sort?: (a: FrontendTransaction.Transaction, b: FrontendTransaction.Transaction) => number;
|
|
64
70
|
/** Message to display when there are no quotes */
|
|
65
71
|
noQuotesMessage?: string;
|
|
66
72
|
entityId: string;
|
|
@@ -97,10 +103,16 @@ declare const Checkout: ({ entityId, onCancel, onSuccess, onFail, invoice, open,
|
|
|
97
103
|
|
|
98
104
|
declare const getQuoteAmountDue: (quote: Quote$1) => number;
|
|
99
105
|
|
|
100
|
-
declare function Signup({ companyName, entityId, priceListCode, returnUrl, isCardEnabled, className, shadow, style, }: {
|
|
106
|
+
declare function Signup({ apiToken, companyName, entityId, priceListCode, returnUrl, isCardEnabled, className, shadow, style, }: {
|
|
107
|
+
/** The API token to use for the signup. Signup needs a Bunny api client token, not a portalSessionToken. */
|
|
108
|
+
apiToken: string;
|
|
109
|
+
/** The company name to display on the signup page */
|
|
101
110
|
companyName: string;
|
|
111
|
+
/** The entity ID to use for the signup */
|
|
102
112
|
entityId: string;
|
|
113
|
+
/** The price list code to use for the signup */
|
|
103
114
|
priceListCode: string;
|
|
115
|
+
/** The return URL to that customers can be redirected to after signup */
|
|
104
116
|
returnUrl?: string;
|
|
105
117
|
/** Whether or not to display signup within a card */
|
|
106
118
|
isCardEnabled?: boolean;
|
|
@@ -112,20 +124,19 @@ declare function Signup({ companyName, entityId, priceListCode, returnUrl, isCar
|
|
|
112
124
|
style?: React.CSSProperties;
|
|
113
125
|
}): react_jsx_runtime.JSX.Element;
|
|
114
126
|
|
|
115
|
-
declare function BunnyProvider({
|
|
116
|
-
accountId?: string;
|
|
127
|
+
declare function BunnyProvider({ children, darkMode, queryClient, apiHost, token, onTokenExpired, configProviderProps, }: {
|
|
117
128
|
children: React.ReactNode;
|
|
118
129
|
darkMode?: boolean;
|
|
119
130
|
queryClient?: QueryClient;
|
|
120
131
|
apiHost: string;
|
|
121
132
|
token: string;
|
|
122
|
-
window: Window;
|
|
123
133
|
onTokenExpired?: () => void;
|
|
134
|
+
configProviderProps?: ThemeConfig | undefined;
|
|
124
135
|
}): react_jsx_runtime.JSX.Element;
|
|
125
136
|
|
|
126
|
-
declare function Transactions({ transactionComponent, showSearchBar, showTitle, title, columns, className, shadow, searchBarClassName, useModal, onTransactionClick, suppressTransactionDisplay, kindsToShow, style, filter, noTransactionsMessage, entityId, }: {
|
|
137
|
+
declare function Transactions({ transactionComponent, showSearchBar, showTitle, title, columns, className, shadow, searchBarClassName, useModal, onTransactionClick, suppressTransactionDisplay, kindsToShow, style, filter, noTransactionsMessage, entityId, filterTransactions, sortTransactions, }: {
|
|
127
138
|
/** A custom component to render instead of the default invoice component */
|
|
128
|
-
transactionComponent?:
|
|
139
|
+
transactionComponent?: react.ReactNode;
|
|
129
140
|
/** Whether to show the search bar */
|
|
130
141
|
showSearchBar?: boolean;
|
|
131
142
|
/** Whether to show the title */
|
|
@@ -149,13 +160,22 @@ declare function Transactions({ transactionComponent, showSearchBar, showTitle,
|
|
|
149
160
|
/** The kinds of transactions to show */
|
|
150
161
|
kindsToShow?: TransactionKind[];
|
|
151
162
|
/** A custom style to apply to the component */
|
|
152
|
-
style?:
|
|
153
|
-
/** A filter to apply to the transactions. Docs on filter: https://docs.bunny.com/developer/getting-started/using-filters-in-queries
|
|
163
|
+
style?: react.CSSProperties;
|
|
164
|
+
/** A filter to apply to the transactions. Docs on filter: https://docs.bunny.com/developer/getting-started/using-filters-in-queries
|
|
165
|
+
* Filtering is applied on the api side, potentially speeding up the transactions query
|
|
166
|
+
*/
|
|
154
167
|
filter?: string;
|
|
155
168
|
/** Message to display when there are no transactions */
|
|
156
169
|
noTransactionsMessage?: string;
|
|
157
170
|
/** The entity id to pass to the invoice component */
|
|
158
171
|
entityId: string;
|
|
172
|
+
/** A function to filter the transactions
|
|
173
|
+
* Filtering is applied on the client side.
|
|
174
|
+
* This is useful to have more control over the filtering logic.
|
|
175
|
+
*/
|
|
176
|
+
filterTransactions?: (transaction: FrontendTransaction.Transaction) => boolean;
|
|
177
|
+
/** A function to sort the transactions. Runs on the client side. */
|
|
178
|
+
sortTransactions?: (transactionA: FrontendTransaction.Transaction, transactionB: FrontendTransaction.Transaction) => number;
|
|
159
179
|
}): react_jsx_runtime.JSX.Element;
|
|
160
180
|
|
|
161
181
|
declare const Subscriptions: ({ companyName, entityId, gap, shadow, showTitle, className, }: {
|
|
@@ -167,6 +187,14 @@ declare const Subscriptions: ({ companyName, entityId, gap, shadow, showTitle, c
|
|
|
167
187
|
className?: string | undefined;
|
|
168
188
|
}) => react_jsx_runtime.JSX.Element;
|
|
169
189
|
|
|
190
|
+
declare const BillingDetails: ({ entityId, accountId, isCardEnabled, shadow, className, }: {
|
|
191
|
+
entityId: string;
|
|
192
|
+
accountId: string;
|
|
193
|
+
isCardEnabled?: boolean | undefined;
|
|
194
|
+
shadow?: ShadowType | undefined;
|
|
195
|
+
className?: string | undefined;
|
|
196
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
197
|
+
|
|
170
198
|
declare const usePaymentMethod: (graphQLClient: GraphQLClient, accountId?: string) => _tanstack_react_query_build_legacy_types.UseQueryResult<any, Error>;
|
|
171
199
|
|
|
172
|
-
export { BunnyProvider, Checkout, Invoice, PaymentMethod, Quote, Quotes, Signup, Subscriptions, Transactions, getQuoteAmountDue, usePaymentMethod };
|
|
200
|
+
export { BillingDetails, BunnyProvider, Checkout, Invoice, PaymentMethod, Quote, Quotes, Signup, Subscriptions, Transactions, getQuoteAmountDue, usePaymentMethod };
|
package/package.json
CHANGED