@bunnyapp/components 1.0.36 → 1.0.37
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/README.md +59 -20
- package/dist/cjs/index.js +20857 -0
- package/dist/cjs/playground/billingdetails/index.d.ts +1 -0
- package/dist/cjs/playground/main.d.ts +1 -0
- package/dist/cjs/playground/transactions/index.d.ts +1 -0
- package/dist/cjs/src/ajax.d.ts +1 -0
- package/dist/cjs/src/components/BillingDetails/BillingDetails.d.ts +15 -0
- package/dist/cjs/src/components/BillingDetails/BillingDetails.stories.d.ts +14 -0
- package/dist/cjs/src/components/BillingDetails/BillingDetailsForm.d.ts +9 -0
- package/dist/cjs/src/components/BillingDetails/index.d.ts +1 -0
- package/dist/cjs/src/components/BunnyProvider.d.ts +23 -0
- package/dist/cjs/src/components/Card.d.ts +7 -0
- package/dist/cjs/src/components/Checkout/Checkout.d.ts +11 -0
- package/dist/cjs/src/components/Checkout/CouponComponent.d.ts +7 -0
- package/dist/cjs/src/components/Checkout/QuoteCheckout.d.ts +12 -0
- package/dist/cjs/src/components/Checkout/checkoutUtils.d.ts +2 -0
- package/dist/cjs/src/components/Checkout/index.d.ts +2 -0
- package/dist/cjs/src/components/DrawerHeader.d.ts +7 -0
- package/dist/cjs/src/components/Error.d.ts +5 -0
- package/dist/cjs/src/components/FeatureUsageGraph.d.ts +6 -0
- package/dist/cjs/src/components/HeaderModalWrapper.d.ts +2 -0
- package/dist/cjs/src/components/Invoice/Invoice.d.ts +3 -0
- package/dist/cjs/src/components/Invoice/Invoice.stories.d.ts +18 -0
- package/dist/cjs/src/components/Invoice/InvoiceQuoteContext.d.ts +18 -0
- package/dist/cjs/src/components/Invoice/InvoiceQuoteView.d.ts +11 -0
- package/dist/cjs/src/components/Invoice/index.d.ts +8 -0
- package/dist/cjs/src/components/LegacyInvoicePDF.d.ts +5 -0
- package/dist/cjs/src/components/PageWrapper.d.ts +1 -0
- package/dist/cjs/src/components/PandadocPollingModal.d.ts +7 -0
- package/dist/cjs/src/components/PaymentForm/CheckoutFooter.d.ts +9 -0
- package/dist/cjs/src/components/PaymentForm/DemoPay/DemoPayCardCvc.d.ts +7 -0
- package/dist/cjs/src/components/PaymentForm/DemoPay/DemoPayCardNumber.d.ts +7 -0
- package/dist/cjs/src/components/PaymentForm/DemoPay/DemoPayExpiry.d.ts +7 -0
- package/dist/cjs/src/components/PaymentForm/DemoPay/DemoPayForm.d.ts +7 -0
- package/dist/cjs/src/components/PaymentForm/DemoPay/demoPayUtils.d.ts +21 -0
- package/dist/cjs/src/components/PaymentForm/DemoPay/hooks/usePay.d.ts +12 -0
- package/dist/cjs/src/components/PaymentForm/DemoPay/hooks/useSave.d.ts +21 -0
- package/dist/cjs/src/components/PaymentForm/DemoPay/index.d.ts +1 -0
- package/dist/cjs/src/components/PaymentForm/PaymentForm.d.ts +17 -0
- package/dist/cjs/src/components/PaymentForm/PaymentFormTypes.d.ts +24 -0
- package/dist/cjs/src/components/PaymentForm/PaymentMethod/CreditCard/CreditCard.d.ts +22 -0
- package/dist/cjs/src/components/PaymentForm/PaymentMethod/CreditCard/LargCardIcon.d.ts +2 -0
- package/dist/cjs/src/components/PaymentForm/PaymentMethod/CreditCard/PlusIcon.d.ts +4 -0
- package/dist/cjs/src/components/PaymentForm/PaymentMethod/PaymentMethod.d.ts +9 -0
- package/dist/cjs/src/components/PaymentForm/PaymentMethod/PaymentMethod.stories.d.ts +11 -0
- package/dist/cjs/src/components/PaymentForm/PaymentMethod/index.d.ts +1 -0
- package/dist/cjs/src/components/PaymentForm/PaymentMethodDetails.d.ts +9 -0
- package/dist/cjs/src/components/PaymentForm/PaymentMethodSelector.d.ts +7 -0
- package/dist/cjs/src/components/PaymentForm/SavePaymentMethodFooter.d.ts +6 -0
- package/dist/cjs/src/components/PaymentForm/Stripe/PaymentMethodForm.d.ts +7 -0
- package/dist/cjs/src/components/PaymentForm/Stripe/StripeForm.d.ts +7 -0
- package/dist/cjs/src/components/PaymentForm/Stripe/hooks/usePay.d.ts +12 -0
- package/dist/cjs/src/components/PaymentForm/Stripe/hooks/useSave.d.ts +10 -0
- package/dist/cjs/src/components/PaymentForm/Stripe/stripeUtils.d.ts +26 -0
- package/dist/cjs/src/components/PaymentForm/index.d.ts +2 -0
- package/dist/cjs/src/components/PaymentForm/useRemovePaymentMethod.d.ts +3 -0
- package/dist/cjs/src/components/Quote/AcceptQuoteModal.d.ts +9 -0
- package/dist/cjs/src/components/Quote/Quote.d.ts +3 -0
- package/dist/cjs/src/components/Quote/Quote.stories.d.ts +144 -0
- package/dist/cjs/src/components/Quote/StyledModal.d.ts +3 -0
- package/dist/cjs/src/components/Quote/index.d.ts +1 -0
- package/dist/cjs/src/components/Quotes/Quotes.d.ts +40 -0
- package/dist/cjs/src/components/Quotes/Quotes.stories.d.ts +22 -0
- package/dist/cjs/src/components/Quotes/index.d.ts +1 -0
- package/dist/cjs/src/components/Signup/PaymentForms.d.ts +18 -0
- package/dist/cjs/src/components/Signup/PaymentSuccess.d.ts +9 -0
- package/dist/cjs/src/components/Signup/PriceListDisplay.d.ts +6 -0
- package/dist/cjs/src/components/Signup/Signup.d.ts +21 -0
- package/dist/cjs/src/components/Signup/Signup.stories.d.ts +10 -0
- package/dist/cjs/src/components/Signup/index.d.ts +1 -0
- package/dist/cjs/src/components/StateTag.d.ts +4 -0
- package/dist/cjs/src/components/Subscriptions/Subscriptions.d.ts +23 -0
- package/dist/cjs/src/components/Subscriptions/Subscriptions.stories.d.ts +10 -0
- package/dist/cjs/src/components/Subscriptions/SubscriptionsContext.d.ts +8 -0
- package/dist/cjs/src/components/Subscriptions/index.d.ts +1 -0
- package/dist/cjs/src/components/Subscriptions/subscriptionsList/SubscriptionCardActions.d.ts +8 -0
- package/dist/cjs/src/components/Subscriptions/subscriptionsList/SubscriptionCardHeader.d.ts +8 -0
- package/dist/cjs/src/components/Subscriptions/subscriptionsList/SubscriptionChargeTotal.d.ts +6 -0
- package/dist/cjs/src/components/Subscriptions/subscriptionsList/SubscriptionChargeUnitPrice.d.ts +6 -0
- package/dist/cjs/src/components/Subscriptions/subscriptionsList/SubscriptionsList.d.ts +9 -0
- package/dist/cjs/src/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionCardColumnHeaders.d.ts +12 -0
- package/dist/cjs/src/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionCardDesktop.d.ts +8 -0
- package/dist/cjs/src/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionsCardCell.d.ts +9 -0
- package/dist/cjs/src/components/Subscriptions/subscriptionsList/subscriptionCardMobile/SubscriptionCardCellMobile.d.ts +8 -0
- package/dist/cjs/src/components/Subscriptions/subscriptionsList/subscriptionCardMobile/SubscriptionCardMobile.d.ts +5 -0
- package/dist/cjs/src/components/Subscriptions/subscriptionsList/subscriptionUtils.d.ts +16 -0
- package/dist/cjs/src/components/TaxationForm.d.ts +6 -0
- package/dist/cjs/src/components/Transactions/Transactions.d.ts +55 -0
- package/dist/cjs/src/components/Transactions/Transactions.stories.d.ts +26 -0
- package/dist/cjs/src/components/Transactions/TransactionsListContext.d.ts +30 -0
- package/dist/cjs/src/components/Transactions/index.d.ts +1 -0
- package/dist/cjs/src/components/Transactions/transactionsList/TransactionDate.d.ts +4 -0
- package/dist/cjs/src/components/Transactions/transactionsList/TransactionDownload.d.ts +7 -0
- package/dist/cjs/src/components/Transactions/transactionsList/TransactionGridCell.d.ts +2 -0
- package/dist/cjs/src/components/Transactions/transactionsList/TransactionTitle.d.ts +5 -0
- package/dist/cjs/src/components/Transactions/transactionsList/TransactionsEmptyState.d.ts +2 -0
- package/dist/cjs/src/components/Transactions/transactionsList/TransactionsListDesktop.d.ts +7 -0
- package/dist/cjs/src/components/Transactions/transactionsList/TransactionsListMobile.d.ts +6 -0
- package/dist/cjs/src/components/Transactions/transactionsList/utils.d.ts +3 -0
- package/dist/cjs/src/components/icons/ArrowDownToLine.d.ts +5 -0
- package/dist/cjs/src/components/icons/CardIcon.d.ts +2 -0
- package/dist/cjs/src/components/index.d.ts +10 -0
- package/dist/cjs/src/contexts/BrandContext.d.ts +7 -0
- package/dist/cjs/src/contexts/NavigationContext.d.ts +9 -0
- package/dist/cjs/src/contexts/PaymentContext.d.ts +10 -0
- package/dist/cjs/src/enums/SubscriptionState.d.ts +8 -0
- package/dist/cjs/src/graphql/mutations/accountSignup.d.ts +12 -0
- package/dist/cjs/src/graphql/mutations/accountUpdate.d.ts +7 -0
- package/dist/cjs/src/graphql/mutations/billingDetailsUpdate.d.ts +6 -0
- package/dist/cjs/src/graphql/mutations/checkout.d.ts +23 -0
- package/dist/cjs/src/graphql/mutations/quoteAccountSignup.d.ts +14 -0
- package/dist/cjs/src/graphql/mutations/quoteAddCoupon.d.ts +8 -0
- package/dist/cjs/src/graphql/mutations/quoteCompose.d.ts +13 -0
- package/dist/cjs/src/graphql/mutations/quoteRecalculateTaxes.d.ts +6 -0
- package/dist/cjs/src/graphql/mutations/quoteSubscriptionReinstate.d.ts +7 -0
- package/dist/cjs/src/graphql/queries/getBillingDetails.d.ts +6 -0
- package/dist/cjs/src/graphql/queries/getBranding.d.ts +6 -0
- package/dist/cjs/src/graphql/queries/getFeatureUsage.d.ts +10 -0
- package/dist/cjs/src/graphql/queries/getFormattedQuote.d.ts +7 -0
- package/dist/cjs/src/graphql/queries/getPlanChangeOptions.d.ts +8 -0
- package/dist/cjs/src/graphql/queries/getPriceList.d.ts +7 -0
- package/dist/cjs/src/graphql/queries/getQuotes.d.ts +6 -0
- package/dist/cjs/src/graphql/queries/getSubscriptions.d.ts +7 -0
- package/dist/cjs/src/graphql/queries/getTaxationRequiredAccountFields.d.ts +6 -0
- package/dist/cjs/src/graphql/queries/getTransactions.d.ts +3 -0
- package/dist/cjs/src/hooks/index.d.ts +1 -0
- package/dist/cjs/src/hooks/quotes/useSendAcceptQuote.d.ts +20 -0
- package/dist/cjs/src/hooks/quotes/useSigningComplete.d.ts +5 -0
- package/dist/cjs/src/hooks/subscriptions/useSubscriptions.d.ts +5 -0
- package/dist/cjs/src/hooks/useFocusFirstInput.d.ts +7 -0
- package/dist/cjs/src/hooks/useHasTaxPlugin.d.ts +6 -0
- package/dist/cjs/src/hooks/useIsExpired.d.ts +2 -0
- package/dist/cjs/src/hooks/usePaymentMethod.d.ts +5 -0
- package/dist/cjs/src/hooks/usePaymentPlugins.d.ts +11 -0
- package/dist/cjs/src/hooks/usePlugins.d.ts +6 -0
- package/dist/cjs/src/hooks/useSigningPlugins.d.ts +6 -0
- package/dist/cjs/src/hooks/useToken.d.ts +2 -0
- package/dist/cjs/src/index.d.ts +3 -0
- package/dist/cjs/src/mocks/browser.d.ts +1 -0
- package/dist/cjs/src/mocks/handlers.d.ts +1 -0
- package/dist/cjs/src/storybook-utils.d.ts +10 -0
- package/dist/cjs/src/types/billingDetails.d.ts +14 -0
- package/dist/cjs/src/types/shadowType.d.ts +1 -0
- package/dist/cjs/src/utils/GraphQLClient.d.ts +2 -0
- package/dist/cjs/src/utils/quoteInvoiceUtils.d.ts +6 -0
- package/dist/cjs/src/utils/styled.d.ts +3 -0
- package/dist/cjs/vite.config.d.ts +2 -0
- package/dist/esm/index.js +109 -137
- package/dist/esm/src/ajax.d.ts +1 -1
- package/dist/esm/src/components/BunnyProvider.d.ts +2 -2
- package/dist/esm/src/components/LegacyInvoicePDF.d.ts +1 -1
- package/dist/esm/src/components/PaymentForm/DemoPay/demoPayUtils.d.ts +1 -1
- package/dist/esm/src/components/PaymentForm/DemoPay/hooks/useSave.d.ts +1 -1
- package/dist/esm/src/components/PaymentForm/PaymentForm.d.ts +3 -1
- package/dist/esm/src/components/PaymentForm/PaymentMethodDetails.d.ts +3 -1
- package/dist/esm/src/components/PaymentForm/Stripe/stripeUtils.d.ts +3 -3
- package/dist/esm/src/components/PaymentForm/index.d.ts +1 -0
- package/dist/esm/src/components/PaymentForm/useRemovePaymentMethod.d.ts +1 -1
- package/dist/esm/src/components/Transactions/Transactions.d.ts +2 -1
- package/dist/esm/src/components/Transactions/transactionsList/TransactionDownload.d.ts +1 -1
- package/dist/esm/src/components/Transactions/transactionsList/TransactionsListDesktop.d.ts +1 -1
- package/dist/esm/src/components/index.d.ts +1 -1
- package/dist/esm/src/graphql/mutations/accountUpdate.d.ts +1 -1
- package/dist/esm/src/graphql/mutations/billingDetailsUpdate.d.ts +1 -1
- package/dist/esm/src/graphql/mutations/checkout.d.ts +1 -1
- package/dist/esm/src/graphql/mutations/quoteAccountSignup.d.ts +1 -1
- package/dist/esm/src/graphql/mutations/quoteAddCoupon.d.ts +1 -1
- package/dist/esm/src/graphql/queries/getBillingDetails.d.ts +1 -1
- package/dist/esm/src/graphql/queries/getBranding.d.ts +1 -1
- package/dist/esm/src/graphql/queries/getFeatureUsage.d.ts +1 -1
- package/dist/esm/src/graphql/queries/getFormattedQuote.d.ts +1 -1
- package/dist/esm/src/graphql/queries/getPlanChangeOptions.d.ts +1 -1
- package/dist/esm/src/graphql/queries/getPriceList.d.ts +1 -1
- package/dist/esm/src/graphql/queries/getQuotes.d.ts +1 -1
- package/dist/esm/src/graphql/queries/getSubscriptions.d.ts +1 -1
- package/dist/esm/src/graphql/queries/getTransactions.d.ts +1 -1
- package/dist/esm/src/hooks/quotes/useSendAcceptQuote.d.ts +1 -1
- package/dist/esm/src/hooks/quotes/useSigningComplete.d.ts +1 -1
- package/dist/esm/src/hooks/usePaymentMethod.d.ts +1 -1
- package/dist/esm/src/hooks/usePaymentPlugins.d.ts +1 -1
- package/dist/esm/src/hooks/usePlugins.d.ts +1 -1
- package/dist/esm/src/hooks/useSigningPlugins.d.ts +1 -1
- package/dist/esm/src/hooks/useToken.d.ts +1 -1
- package/dist/esm/src/utils/GraphQLClient.d.ts +1 -1
- package/dist/index.d.ts +23 -8
- package/package.json +2 -3
package/dist/esm/src/ajax.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useDownloadFile: (id?: string, onError?: ((error: any) => void) | undefined) => (url: string, token
|
|
1
|
+
export declare const useDownloadFile: (id?: string, onError?: ((error: any) => void) | undefined) => (url: string, token?: string) => Promise<any>;
|
|
@@ -5,7 +5,7 @@ import { GraphQLClient } from "graphql-request";
|
|
|
5
5
|
export type BunnyContextValues = {
|
|
6
6
|
apiHost: string;
|
|
7
7
|
graphQLClient: GraphQLClient;
|
|
8
|
-
token
|
|
8
|
+
token?: string;
|
|
9
9
|
displayPayButtonNameAnyways?: boolean;
|
|
10
10
|
darkMode?: boolean;
|
|
11
11
|
onTokenExpired?: () => void;
|
|
@@ -16,7 +16,7 @@ declare function BunnyProvider({ children, darkMode, queryClient, apiHost, token
|
|
|
16
16
|
darkMode?: boolean;
|
|
17
17
|
queryClient?: QueryClient;
|
|
18
18
|
apiHost: string;
|
|
19
|
-
token
|
|
19
|
+
token?: string;
|
|
20
20
|
onTokenExpired?: () => void;
|
|
21
21
|
configProviderProps?: ThemeConfig | undefined;
|
|
22
22
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -17,5 +17,5 @@ export declare const storePayment: (options: {
|
|
|
17
17
|
testCreditCardCvc: string;
|
|
18
18
|
testCreditCardExpirationDate: string;
|
|
19
19
|
testCreditCardNumber: string;
|
|
20
|
-
token
|
|
20
|
+
token?: string | undefined;
|
|
21
21
|
}, plugin: PluginData, apiHost: string, accountId?: string) => Promise<any>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormattedInvoice, PluginData, Quote } from "@bunnyapp/common";
|
|
2
3
|
import { GraphQLClient } from "graphql-request";
|
|
3
|
-
export declare const PaymentForm: ({ entityId, invoice, onFail, onPaymentSuccess, quote, accountId, onSavePaymentMethod, overrideToken, graphQLClient, customCheckoutFunction, currencyId: currencyIdFromProps, }: {
|
|
4
|
+
export declare const PaymentForm: ({ entityId, invoice, onFail, onPaymentSuccess, quote, accountId, onSavePaymentMethod, overrideToken, graphQLClient, customCheckoutFunction, currencyId: currencyIdFromProps, customPaymentForms, }: {
|
|
4
5
|
entityId: string;
|
|
5
6
|
invoice?: FormattedInvoice | undefined;
|
|
6
7
|
quote?: Quote | undefined;
|
|
@@ -12,4 +13,5 @@ export declare const PaymentForm: ({ entityId, invoice, onFail, onPaymentSuccess
|
|
|
12
13
|
graphQLClient: GraphQLClient;
|
|
13
14
|
customCheckoutFunction?: ((plugin: PluginData | undefined) => Promise<any>) | undefined;
|
|
14
15
|
currencyId?: string | undefined;
|
|
16
|
+
customPaymentForms?: Record<string, import("react").ReactNode> | undefined;
|
|
15
17
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { PaymentMethod, PluginData } from "@bunnyapp/common";
|
|
2
|
-
declare const PaymentMethodDetails: ({ onFail, paymentMethod, onSavePaymentMethod, }: {
|
|
3
|
+
declare const PaymentMethodDetails: ({ onFail, paymentMethod, onSavePaymentMethod, customPaymentForms, }: {
|
|
3
4
|
onFail: (error: any) => void;
|
|
4
5
|
paymentMethod: PaymentMethod | PluginData;
|
|
5
6
|
onSavePaymentMethod: () => void;
|
|
7
|
+
customPaymentForms?: Record<string, import("react").ReactNode> | undefined;
|
|
6
8
|
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
9
|
export default PaymentMethodDetails;
|
|
@@ -3,11 +3,11 @@ import { PluginData, Payable } from "@bunnyapp/common";
|
|
|
3
3
|
export declare const createPaymentMethod: ({ paymentMethodId, plugin, token, apiHost, accountId, }: {
|
|
4
4
|
paymentMethodId: string;
|
|
5
5
|
plugin: PluginData;
|
|
6
|
-
token
|
|
6
|
+
token?: string | undefined;
|
|
7
7
|
apiHost: string;
|
|
8
8
|
accountId?: string | undefined;
|
|
9
9
|
}) => Promise<any>;
|
|
10
|
-
export declare const createSetupIntent: (plugin: PluginData,
|
|
10
|
+
export declare const createSetupIntent: (plugin: PluginData, apiHost: string, token?: string, accountId?: string) => Promise<any>;
|
|
11
11
|
export declare const createPaymentIntent: ({ payable, savePaymentMethod, memo, plugin, token, apiHost, }: {
|
|
12
12
|
payable: Payable;
|
|
13
13
|
savePaymentMethod: boolean;
|
|
@@ -16,7 +16,7 @@ export declare const createPaymentIntent: ({ payable, savePaymentMethod, memo, p
|
|
|
16
16
|
token: string;
|
|
17
17
|
apiHost: string;
|
|
18
18
|
}) => Promise<any>;
|
|
19
|
-
export declare const useStripePlugin: (plugin: PluginData | undefined,
|
|
19
|
+
export declare const useStripePlugin: (plugin: PluginData | undefined, apiHost: string, currencyId: string, token?: string, accountId?: string) => {
|
|
20
20
|
stripe: Stripe | null;
|
|
21
21
|
options: {
|
|
22
22
|
mode: "setup";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PluginData } from "@bunnyapp/common";
|
|
2
|
-
declare function useRemovePaymentMethod(paymentPlugins: PluginData[],
|
|
2
|
+
declare function useRemovePaymentMethod(paymentPlugins: PluginData[], apiHost: string, entityId: string, token?: string, accountId?: string): (data: any) => Promise<void>;
|
|
3
3
|
export default useRemovePaymentMethod;
|
|
@@ -1,6 +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
|
+
import { TransactionListColumnType } from "./transactionsList/TransactionsListDesktop";
|
|
4
5
|
import { TransactionDateType } from "./TransactionsListContext";
|
|
5
6
|
export default function Transactions({ transactionComponent, showSearchBar, showTitle, title, columns, className, shadow, searchBarClassName, useModal, onTransactionClick, suppressTransactionDisplay, kindsToShow, style, filter, noTransactionsMessage, entityId, filterTransactions, sortTransactions, transactionDateType, }: {
|
|
6
7
|
/** A custom component to render instead of the default invoice component */
|
|
@@ -12,7 +13,7 @@ export default function Transactions({ transactionComponent, showSearchBar, show
|
|
|
12
13
|
/** The title to display in the transactions list */
|
|
13
14
|
title?: string;
|
|
14
15
|
/** The columns to display in the transactions list */
|
|
15
|
-
columns?:
|
|
16
|
+
columns?: TransactionListColumnType[];
|
|
16
17
|
/** A custom class name to apply to the component */
|
|
17
18
|
className?: string;
|
|
18
19
|
/** Whether to use a modal for the invoice drawer */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FrontendTransaction as T } from "@bunnyapp/common";
|
|
2
2
|
declare const TransactionDownload: ({ transaction, token, apiHost, }: {
|
|
3
3
|
transaction: T.Transaction;
|
|
4
|
-
token
|
|
4
|
+
token?: string | undefined;
|
|
5
5
|
apiHost: string;
|
|
6
6
|
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
7
|
export default TransactionDownload;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FrontendTransaction as T } from "@bunnyapp/common";
|
|
2
|
-
export type TransactionListColumnType = "date
|
|
2
|
+
export type TransactionListColumnType = "date" | "title" | "state" | "amount" | "download" | "accountName";
|
|
3
3
|
declare const TransactionsListDesktop: ({ transactions, onTransactionClick, }: {
|
|
4
4
|
transactions: T.Transaction[];
|
|
5
5
|
onTransactionClick?: ((transaction: T.Transaction) => void) | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { Invoice } from "./Invoice";
|
|
2
2
|
export { Quote } from "./Quote";
|
|
3
3
|
export { Quotes } from "./Quotes";
|
|
4
|
-
export { PaymentMethod } from "./PaymentForm
|
|
4
|
+
export { PaymentMethod, PaymentForm } from "./PaymentForm";
|
|
5
5
|
export * from "./Checkout";
|
|
6
6
|
export { Signup } from "./Signup";
|
|
7
7
|
export { default as BunnyProvider } from "./BunnyProvider";
|
|
@@ -15,7 +15,7 @@ declare const checkout: ({ quoteId, invoiceId, paymentMethodId, paymentMethodDat
|
|
|
15
15
|
savePaymentMethod?: boolean | undefined;
|
|
16
16
|
metadata?: Record<string, any> | undefined;
|
|
17
17
|
} | undefined;
|
|
18
|
-
token
|
|
18
|
+
token?: string | undefined;
|
|
19
19
|
apiHost: string;
|
|
20
20
|
}) => Promise<{
|
|
21
21
|
savePaymentMethod: boolean | undefined;
|
|
@@ -4,7 +4,7 @@ type BillingContact = {
|
|
|
4
4
|
email: string;
|
|
5
5
|
};
|
|
6
6
|
declare const quoteAccountSignup: ({ token, apiHost, entityId, priceListCode, accountName, billingContact, }: {
|
|
7
|
-
token
|
|
7
|
+
token?: string | undefined;
|
|
8
8
|
apiHost: string;
|
|
9
9
|
entityId: string;
|
|
10
10
|
priceListCode: string;
|
|
@@ -2,7 +2,7 @@ import { Quote } from "@bunnyapp/common";
|
|
|
2
2
|
declare const quoteAddCoupon: ({ quoteId, couponCode, token, apiHost, }: {
|
|
3
3
|
quoteId?: string | undefined;
|
|
4
4
|
couponCode?: string | undefined;
|
|
5
|
-
token
|
|
5
|
+
token?: string | undefined;
|
|
6
6
|
apiHost: string;
|
|
7
7
|
}) => Promise<Quote>;
|
|
8
8
|
export default quoteAddCoupon;
|
|
@@ -4,7 +4,7 @@ declare const getFeatureUsage: ({ subscriptionChargeId, startDate, endDate, data
|
|
|
4
4
|
startDate?: string | undefined;
|
|
5
5
|
endDate?: string | undefined;
|
|
6
6
|
dataInterval?: number | undefined;
|
|
7
|
-
token
|
|
7
|
+
token?: string | undefined;
|
|
8
8
|
apiHost: string;
|
|
9
9
|
}) => Promise<FeatureUsage>;
|
|
10
10
|
export default getFeatureUsage;
|
|
@@ -2,6 +2,6 @@ import { FormattedQuote } from "@bunnyapp/common";
|
|
|
2
2
|
declare const getFormattedQuote: ({ id, token, apiHost, }: {
|
|
3
3
|
id?: string | undefined;
|
|
4
4
|
apiHost: string;
|
|
5
|
-
token
|
|
5
|
+
token?: string | undefined;
|
|
6
6
|
}) => Promise<FormattedQuote>;
|
|
7
7
|
export default getFormattedQuote;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Subscription } from "@bunnyapp/common";
|
|
2
2
|
declare const getPlanChangeOptions: ({ isInPreviewMode, token, upgradingSubscription, apiHost, }: {
|
|
3
3
|
isInPreviewMode?: boolean | undefined;
|
|
4
|
-
token
|
|
4
|
+
token?: string | undefined;
|
|
5
5
|
upgradingSubscription?: Subscription | undefined;
|
|
6
6
|
apiHost: string;
|
|
7
7
|
}) => Promise<any>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { FrontendTransaction as T } from "@bunnyapp/common";
|
|
2
|
-
declare const getTransactions: (filter: string,
|
|
2
|
+
declare const getTransactions: (filter: string, apiHost: string, token?: string) => Promise<T.Transaction[]>;
|
|
3
3
|
export default getTransactions;
|
|
@@ -4,7 +4,7 @@ declare const useSendAcceptQuote: ({ entityId, onTokenExpired, quoteId, apiHost,
|
|
|
4
4
|
onTokenExpired?: (() => void) | undefined;
|
|
5
5
|
quoteId?: string | undefined;
|
|
6
6
|
apiHost: string;
|
|
7
|
-
token
|
|
7
|
+
token?: string | undefined;
|
|
8
8
|
}) => {
|
|
9
9
|
acceptBoxVisible: boolean;
|
|
10
10
|
isAccepting: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GraphQLClient } from "graphql-request";
|
|
2
|
-
export declare const usePaymentMethod: (graphQLClient: GraphQLClient, entityId?: string, token?: string) => {
|
|
2
|
+
export declare const usePaymentMethod: (graphQLClient: GraphQLClient, entityId?: string, token?: string, accountId?: string) => {
|
|
3
3
|
data: any;
|
|
4
4
|
isLoading: boolean;
|
|
5
5
|
};
|
|
@@ -2,7 +2,7 @@ import { PluginData } from "@bunnyapp/common";
|
|
|
2
2
|
export declare const usePaymentPlugins: ({ entityId, apiHost, token, }: {
|
|
3
3
|
entityId: string;
|
|
4
4
|
apiHost: string;
|
|
5
|
-
token
|
|
5
|
+
token?: string | undefined;
|
|
6
6
|
}) => {
|
|
7
7
|
paymentPlugins: PluginData[] | undefined;
|
|
8
8
|
paymentMethodAllowedPlugins: PluginData[] | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function useToken(): string;
|
|
1
|
+
declare function useToken(): string | undefined;
|
|
2
2
|
export default useToken;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { GraphQLClient } from "graphql-request";
|
|
2
|
-
export declare const createGraphQLClient: (
|
|
2
|
+
export declare const createGraphQLClient: (apiHost: string, token?: string) => GraphQLClient;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import { FormattedInvoice, FormattedQuote, FrontendTransaction, Quote as Quote$1, PriceList, PaymentMethod as PaymentMethod$1, TransactionKind, Subscription } from '@bunnyapp/common';
|
|
4
|
-
import { QueryClient } from '@tanstack/react-query';
|
|
5
|
-
import { ThemeConfig } from 'antd';
|
|
3
|
+
import { FormattedInvoice, FormattedQuote, FrontendTransaction, Quote as Quote$1, PluginData, PriceList, PaymentMethod as PaymentMethod$1, TransactionKind, Subscription } from '@bunnyapp/common';
|
|
6
4
|
import * as react from 'react';
|
|
7
5
|
import react__default from 'react';
|
|
8
6
|
import { GraphQLClient } from 'graphql-request';
|
|
7
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
8
|
+
import { ThemeConfig } from 'antd';
|
|
9
9
|
|
|
10
10
|
type ShadowType = "shadow-none" | "shadow-sm" | "shadow-md" | "shadow-lg" | "shadow-xl";
|
|
11
11
|
|
|
@@ -36,7 +36,7 @@ declare global {
|
|
|
36
36
|
|
|
37
37
|
declare function Quote({ id, invoiceQuoteViewComponent, onInvoiceDownloadError, onPaymentSuccess, entityId, shadow, className, hideDownloadButton, onQuoteLoaded, }: InvoiceQuoteContextProps): react_jsx_runtime.JSX.Element;
|
|
38
38
|
|
|
39
|
-
type TransactionListColumnType = "date
|
|
39
|
+
type TransactionListColumnType = "date" | "title" | "state" | "amount" | "download" | "accountName";
|
|
40
40
|
|
|
41
41
|
declare function Quotes({ className, columns, entityId, filter, filterQuotes, sort, noQuotesMessage, onQuoteClick, quoteComponent, searchBarClassName, shadow, showSearchBar, showTitle, title, style, suppressQuoteDisplay, useModal, }: {
|
|
42
42
|
/** A custom component to render instead of the default invoice component */
|
|
@@ -82,6 +82,21 @@ declare const PaymentMethod: ({ entityId, className, shadow, cardEnabled, useMod
|
|
|
82
82
|
useModal?: boolean | undefined;
|
|
83
83
|
}) => react_jsx_runtime.JSX.Element;
|
|
84
84
|
|
|
85
|
+
declare const PaymentForm: ({ entityId, invoice, onFail, onPaymentSuccess, quote, accountId, onSavePaymentMethod, overrideToken, graphQLClient, customCheckoutFunction, currencyId: currencyIdFromProps, customPaymentForms, }: {
|
|
86
|
+
entityId: string;
|
|
87
|
+
invoice?: FormattedInvoice | undefined;
|
|
88
|
+
quote?: Quote$1 | undefined;
|
|
89
|
+
onFail: (error: any) => void;
|
|
90
|
+
onPaymentSuccess?: (() => void) | undefined;
|
|
91
|
+
onSavePaymentMethod?: (() => void) | undefined;
|
|
92
|
+
accountId?: string | undefined;
|
|
93
|
+
overrideToken?: string | undefined;
|
|
94
|
+
graphQLClient: GraphQLClient;
|
|
95
|
+
customCheckoutFunction?: ((plugin: PluginData | undefined) => Promise<any>) | undefined;
|
|
96
|
+
currencyId?: string | undefined;
|
|
97
|
+
customPaymentForms?: Record<string, react.ReactNode> | undefined;
|
|
98
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
99
|
+
|
|
85
100
|
type CheckoutProps = {
|
|
86
101
|
invoice?: FormattedInvoice;
|
|
87
102
|
onCancel: () => void;
|
|
@@ -128,7 +143,7 @@ declare function BunnyProvider({ children, darkMode, queryClient, apiHost, token
|
|
|
128
143
|
darkMode?: boolean;
|
|
129
144
|
queryClient?: QueryClient;
|
|
130
145
|
apiHost: string;
|
|
131
|
-
token
|
|
146
|
+
token?: string;
|
|
132
147
|
onTokenExpired?: () => void;
|
|
133
148
|
configProviderProps?: ThemeConfig | undefined;
|
|
134
149
|
}): react_jsx_runtime.JSX.Element;
|
|
@@ -145,7 +160,7 @@ declare function Transactions({ transactionComponent, showSearchBar, showTitle,
|
|
|
145
160
|
/** The title to display in the transactions list */
|
|
146
161
|
title?: string;
|
|
147
162
|
/** The columns to display in the transactions list */
|
|
148
|
-
columns?:
|
|
163
|
+
columns?: TransactionListColumnType[];
|
|
149
164
|
/** A custom class name to apply to the component */
|
|
150
165
|
className?: string;
|
|
151
166
|
/** Whether to use a modal for the invoice drawer */
|
|
@@ -210,9 +225,9 @@ declare const BillingDetails: ({ entityId, isCardEnabled, shadow, className, hid
|
|
|
210
225
|
}) => boolean) | undefined;
|
|
211
226
|
}) => react_jsx_runtime.JSX.Element;
|
|
212
227
|
|
|
213
|
-
declare const usePaymentMethod: (graphQLClient: GraphQLClient, entityId?: string, token?: string) => {
|
|
228
|
+
declare const usePaymentMethod: (graphQLClient: GraphQLClient, entityId?: string, token?: string, accountId?: string) => {
|
|
214
229
|
data: any;
|
|
215
230
|
isLoading: boolean;
|
|
216
231
|
};
|
|
217
232
|
|
|
218
|
-
export { BillingDetails, BunnyProvider, Checkout, Invoice, PaymentMethod, Quote, Quotes, Signup, Subscriptions, Transactions, getQuoteAmountDue, usePaymentMethod };
|
|
233
|
+
export { BillingDetails, BunnyProvider, Checkout, Invoice, PaymentForm, PaymentMethod, Quote, Quotes, Signup, Subscriptions, Transactions, getQuoteAmountDue, usePaymentMethod };
|
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bunnyapp/components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.37",
|
|
4
4
|
"description": "Components from the Bunny portal to embed Bunny UI functionality into your application.",
|
|
5
|
-
"main": "dist/
|
|
5
|
+
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
7
|
-
"type": "module",
|
|
8
7
|
"files": [
|
|
9
8
|
"dist"
|
|
10
9
|
],
|