@bunnyapp/components 1.0.11 → 1.0.13
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 +1112 -1214
- package/dist/cjs/src/components/BillingDetails/BillingDetails.d.ts +10 -0
- package/dist/cjs/src/components/BillingDetails/BillingDetails.stories.d.ts +11 -0
- package/dist/cjs/src/components/BillingDetails/index.d.ts +1 -0
- package/dist/cjs/src/components/BunnyProvider.d.ts +3 -3
- package/dist/cjs/src/components/Checkout/InvoiceCheckout.d.ts +1 -21
- package/dist/cjs/src/components/Checkout/QuoteCheckout.d.ts +1 -1
- package/dist/cjs/src/components/Invoice/Invoice.d.ts +8 -2
- package/dist/cjs/src/components/Invoice/Invoice.stories.d.ts +14 -5
- package/dist/cjs/src/components/PageHeaderWithActions.d.ts +2 -1
- package/dist/cjs/src/components/PaymentForm/CheckoutFooter.d.ts +8 -7
- package/dist/cjs/src/components/PaymentForm/DemoPay/DemoPayForm.d.ts +6 -2
- package/dist/cjs/src/components/PaymentForm/DemoPay/demoPayUtils.d.ts +1 -3
- package/dist/cjs/src/components/PaymentForm/DemoPay/hooks/usePay.d.ts +13 -0
- package/dist/cjs/src/components/PaymentForm/DemoPay/hooks/useSave.d.ts +21 -0
- package/dist/cjs/src/components/PaymentForm/PaymentForm.d.ts +10 -6
- package/dist/cjs/src/components/PaymentForm/PaymentFormTypes.d.ts +0 -8
- package/dist/cjs/src/components/PaymentForm/PaymentMethod/CreditCard/CreditCard.d.ts +12 -2
- package/dist/cjs/src/components/PaymentForm/PaymentMethod/PaymentMethod.d.ts +6 -4
- package/dist/cjs/src/components/PaymentForm/PaymentMethod/PaymentMethod.stories.d.ts +11 -0
- package/dist/cjs/src/components/PaymentForm/PaymentMethodDetails.d.ts +8 -0
- package/dist/cjs/src/components/PaymentForm/PaymentMethodSelector.d.ts +2 -3
- package/dist/cjs/src/components/PaymentForm/SavePaymentMethodFooter.d.ts +6 -0
- package/dist/cjs/src/components/PaymentForm/Stripe/PaymentMethodForm.d.ts +6 -2
- package/dist/cjs/src/components/PaymentForm/Stripe/StripeForm.d.ts +6 -2
- 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 +9 -3
- package/dist/cjs/src/components/PaymentForm/useRemovePaymentMethod.d.ts +3 -0
- package/dist/cjs/src/components/Quote/Quote.d.ts +2 -4
- package/dist/cjs/src/components/Quote/Quote.stories.d.ts +122 -6
- package/dist/cjs/src/components/Quotes/Quotes.d.ts +8 -4
- package/dist/cjs/src/components/Quotes/Quotes.stories.d.ts +22 -0
- package/dist/cjs/src/components/Signup/PaymentForms.d.ts +2 -4
- package/dist/cjs/src/components/Signup/Signup.d.ts +11 -1
- package/dist/cjs/src/components/Signup/Signup.stories.d.ts +6 -4
- package/dist/cjs/src/components/StateTag.d.ts +3 -5
- package/dist/cjs/src/components/Subscriptions/Subscriptions.d.ts +2 -1
- package/dist/cjs/src/components/Subscriptions/Subscriptions.stories.d.ts +10 -0
- package/dist/cjs/src/components/Transactions/Transactions.d.ts +7 -5
- package/dist/cjs/src/components/Transactions/Transactions.stories.d.ts +15 -6
- package/dist/cjs/src/components/Transactions/TransactionsListContext.d.ts +5 -1
- package/dist/cjs/src/components/Transactions/transactionsList/TransactionsListDesktop.d.ts +1 -1
- package/dist/cjs/src/contexts/PaymentContext.d.ts +2 -2
- package/dist/cjs/src/graphql/queries/getAccount.d.ts +1 -1
- package/dist/cjs/src/hooks/quotes/useSendAcceptQuote.d.ts +2 -2
- package/dist/cjs/src/hooks/usePaymentMethod.d.ts +1 -1
- package/dist/cjs/src/mocks/handlers.d.ts +1 -1
- package/dist/cjs/src/storybook-utils.d.ts +10 -0
- package/dist/cjs/src/types/shadowType.d.ts +1 -0
- package/dist/esm/index.js +1116 -1218
- package/dist/esm/src/components/BillingDetails/BillingDetails.d.ts +10 -0
- package/dist/esm/src/components/BillingDetails/BillingDetails.stories.d.ts +11 -0
- package/dist/esm/src/components/BillingDetails/index.d.ts +1 -0
- package/dist/esm/src/components/BunnyProvider.d.ts +3 -3
- package/dist/esm/src/components/Checkout/InvoiceCheckout.d.ts +1 -21
- package/dist/esm/src/components/Checkout/QuoteCheckout.d.ts +1 -1
- package/dist/esm/src/components/Invoice/Invoice.d.ts +8 -2
- package/dist/esm/src/components/Invoice/Invoice.stories.d.ts +14 -5
- package/dist/esm/src/components/PageHeaderWithActions.d.ts +2 -1
- package/dist/esm/src/components/PaymentForm/CheckoutFooter.d.ts +8 -7
- package/dist/esm/src/components/PaymentForm/DemoPay/DemoPayForm.d.ts +6 -2
- package/dist/esm/src/components/PaymentForm/DemoPay/demoPayUtils.d.ts +1 -3
- package/dist/esm/src/components/PaymentForm/DemoPay/hooks/usePay.d.ts +13 -0
- package/dist/esm/src/components/PaymentForm/DemoPay/hooks/useSave.d.ts +21 -0
- package/dist/esm/src/components/PaymentForm/PaymentForm.d.ts +10 -6
- package/dist/esm/src/components/PaymentForm/PaymentFormTypes.d.ts +0 -8
- package/dist/esm/src/components/PaymentForm/PaymentMethod/CreditCard/CreditCard.d.ts +12 -2
- package/dist/esm/src/components/PaymentForm/PaymentMethod/PaymentMethod.d.ts +6 -4
- package/dist/esm/src/components/PaymentForm/PaymentMethod/PaymentMethod.stories.d.ts +11 -0
- package/dist/esm/src/components/PaymentForm/PaymentMethodDetails.d.ts +8 -0
- package/dist/esm/src/components/PaymentForm/PaymentMethodSelector.d.ts +2 -3
- package/dist/esm/src/components/PaymentForm/SavePaymentMethodFooter.d.ts +6 -0
- package/dist/esm/src/components/PaymentForm/Stripe/PaymentMethodForm.d.ts +6 -2
- package/dist/esm/src/components/PaymentForm/Stripe/StripeForm.d.ts +6 -2
- package/dist/esm/src/components/PaymentForm/Stripe/hooks/usePay.d.ts +12 -0
- package/dist/esm/src/components/PaymentForm/Stripe/hooks/useSave.d.ts +10 -0
- package/dist/esm/src/components/PaymentForm/Stripe/stripeUtils.d.ts +9 -3
- package/dist/esm/src/components/PaymentForm/useRemovePaymentMethod.d.ts +3 -0
- package/dist/esm/src/components/Quote/Quote.d.ts +2 -4
- package/dist/esm/src/components/Quote/Quote.stories.d.ts +122 -6
- package/dist/esm/src/components/Quotes/Quotes.d.ts +8 -4
- package/dist/esm/src/components/Quotes/Quotes.stories.d.ts +22 -0
- package/dist/esm/src/components/Signup/PaymentForms.d.ts +2 -4
- package/dist/esm/src/components/Signup/Signup.d.ts +11 -1
- package/dist/esm/src/components/Signup/Signup.stories.d.ts +6 -4
- package/dist/esm/src/components/StateTag.d.ts +3 -5
- package/dist/esm/src/components/Subscriptions/Subscriptions.d.ts +2 -1
- package/dist/esm/src/components/Subscriptions/Subscriptions.stories.d.ts +10 -0
- package/dist/esm/src/components/Transactions/Transactions.d.ts +7 -5
- package/dist/esm/src/components/Transactions/Transactions.stories.d.ts +15 -6
- package/dist/esm/src/components/Transactions/TransactionsListContext.d.ts +5 -1
- package/dist/esm/src/components/Transactions/transactionsList/TransactionsListDesktop.d.ts +1 -1
- package/dist/esm/src/contexts/PaymentContext.d.ts +2 -2
- package/dist/esm/src/graphql/queries/getAccount.d.ts +1 -1
- package/dist/esm/src/hooks/quotes/useSendAcceptQuote.d.ts +2 -2
- package/dist/esm/src/hooks/usePaymentMethod.d.ts +1 -1
- package/dist/esm/src/mocks/handlers.d.ts +1 -1
- package/dist/esm/src/storybook-utils.d.ts +10 -0
- package/dist/esm/src/types/shadowType.d.ts +1 -0
- package/dist/index.d.ts +45 -25
- package/package.json +2 -2
- package/dist/cjs/src/components/PaymentForm/Finix/FinixCardForm.d.ts +0 -4
- package/dist/cjs/src/components/PaymentForm/Finix/index.d.ts +0 -2
- package/dist/cjs/src/components/PaymentForm/FinixAch.d.ts +0 -3
- package/dist/cjs/src/components/PaymentForm/PaymentMethod/PaymentMethodContext.d.ts +0 -5
- package/dist/cjs/src/components/PaymentForm/PaymentMethodForm.d.ts +0 -3
- package/dist/cjs/src/components/PaymentForm/PaymentOption.d.ts +0 -8
- package/dist/cjs/src/components/PaymentForm/StoredPaymentMethod/StoredPaymentMethodForm.d.ts +0 -3
- package/dist/cjs/src/components/PaymentForm/Stripe/CheckoutForm.d.ts +0 -3
- package/dist/cjs/src/components/PaymentForm/Stripe/index.d.ts +0 -1
- package/dist/cjs/src/components/PaymentForm/paymentUtils.d.ts +0 -7
- package/dist/cjs/src/stories/Button.d.ts +0 -15
- package/dist/cjs/src/stories/Button.stories.d.ts +0 -9
- package/dist/cjs/src/stories/Header.d.ts +0 -12
- package/dist/cjs/src/stories/Header.stories.d.ts +0 -7
- package/dist/cjs/src/stories/Page.d.ts +0 -3
- package/dist/cjs/src/stories/Page.stories.d.ts +0 -7
- package/dist/esm/src/components/PaymentForm/Finix/FinixCardForm.d.ts +0 -4
- package/dist/esm/src/components/PaymentForm/Finix/index.d.ts +0 -2
- package/dist/esm/src/components/PaymentForm/FinixAch.d.ts +0 -3
- package/dist/esm/src/components/PaymentForm/PaymentMethod/PaymentMethodContext.d.ts +0 -5
- package/dist/esm/src/components/PaymentForm/PaymentMethodForm.d.ts +0 -3
- package/dist/esm/src/components/PaymentForm/PaymentOption.d.ts +0 -8
- package/dist/esm/src/components/PaymentForm/StoredPaymentMethod/StoredPaymentMethodForm.d.ts +0 -3
- package/dist/esm/src/components/PaymentForm/Stripe/CheckoutForm.d.ts +0 -3
- package/dist/esm/src/components/PaymentForm/Stripe/index.d.ts +0 -1
- package/dist/esm/src/components/PaymentForm/paymentUtils.d.ts +0 -7
- package/dist/esm/src/stories/Button.d.ts +0 -15
- package/dist/esm/src/stories/Button.stories.d.ts +0 -9
- package/dist/esm/src/stories/Header.d.ts +0 -12
- package/dist/esm/src/stories/Header.stories.d.ts +0 -7
- package/dist/esm/src/stories/Page.d.ts +0 -3
- package/dist/esm/src/stories/Page.stories.d.ts +0 -7
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { Quote } from "@bunnyapp/common";
|
|
2
2
|
import { OnPaymentSuccessType } from "../PaymentForm/PaymentFormTypes";
|
|
3
|
-
export default function PaymentForms({ quote,
|
|
3
|
+
export default function PaymentForms({ quote, handlePaymentSaveSuccess, handlePaymentFail, handleSubmit, proceedingToPayment, entityId, accountId, }: {
|
|
4
4
|
quote?: Quote;
|
|
5
|
-
paying: boolean;
|
|
6
|
-
setIsPaying: (paying: boolean) => void;
|
|
7
5
|
handlePaymentSaveSuccess: (paymentSuccess: OnPaymentSuccessType) => void;
|
|
8
6
|
handlePaymentFail: (error: any) => void;
|
|
9
7
|
handleSubmit: (formData: FormData) => void;
|
|
10
8
|
proceedingToPayment: boolean;
|
|
11
|
-
accountId?: string;
|
|
12
9
|
entityId: string;
|
|
10
|
+
accountId?: string;
|
|
13
11
|
}): import("react/jsx-runtime").JSX.Element;
|
|
14
12
|
export type FormData = {
|
|
15
13
|
firstName: string;
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import "../../styles/index.less";
|
|
2
|
-
|
|
3
|
+
import { ShadowType } from "../../types/shadowType";
|
|
4
|
+
export default function Signup({ companyName, entityId, priceListCode, returnUrl, isCardEnabled, className, shadow, style, }: {
|
|
3
5
|
companyName: string;
|
|
4
6
|
entityId: string;
|
|
5
7
|
priceListCode: string;
|
|
6
8
|
returnUrl?: string;
|
|
9
|
+
/** Whether or not to display signup within a card */
|
|
10
|
+
isCardEnabled?: boolean;
|
|
11
|
+
/** A custom class name to apply to the component */
|
|
12
|
+
className?: string;
|
|
13
|
+
/** The shadow level to apply to the component */
|
|
14
|
+
shadow?: ShadowType;
|
|
15
|
+
/** A custom style to apply to the component */
|
|
16
|
+
style?: React.CSSProperties;
|
|
7
17
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import type { StoryObj } from "@storybook/react";
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import Signup from "./Signup";
|
|
3
|
-
declare const meta:
|
|
4
|
-
component: typeof Signup;
|
|
5
|
-
};
|
|
3
|
+
declare const meta: Meta<typeof Signup>;
|
|
6
4
|
export default meta;
|
|
7
5
|
type Story = StoryObj<typeof meta>;
|
|
8
6
|
export declare const Default: Story;
|
|
7
|
+
export declare const NoCard: Story;
|
|
8
|
+
export declare const Mobile: Story;
|
|
9
|
+
export declare const CustomClassName: Story;
|
|
10
|
+
export declare const DarkMode: Story;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
declare const StateTag: ({ state }: StateTagProps) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
declare const StateTag: ({ state }: {
|
|
2
|
+
state: string;
|
|
3
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
4
|
export default StateTag;
|
|
@@ -13,11 +13,12 @@ export type EditingQuoteDataType = {
|
|
|
13
13
|
id: string;
|
|
14
14
|
isTrial: boolean;
|
|
15
15
|
};
|
|
16
|
-
declare const Subscriptions: ({ companyName, entityId, gap, shadow, showTitle, }: {
|
|
16
|
+
declare const Subscriptions: ({ companyName, entityId, gap, shadow, showTitle, className, }: {
|
|
17
17
|
companyName: string;
|
|
18
18
|
entityId: string;
|
|
19
19
|
gap?: number | undefined;
|
|
20
20
|
shadow?: "none" | "lg" | "md" | "sm" | undefined;
|
|
21
21
|
showTitle?: boolean | undefined;
|
|
22
|
+
className?: string | undefined;
|
|
22
23
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
23
24
|
export default Subscriptions;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Subscriptions from "./Subscriptions";
|
|
3
|
+
declare const meta: Meta<typeof Subscriptions>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Mobile: Story;
|
|
8
|
+
export declare const NoShadow: Story;
|
|
9
|
+
export declare const CustomClassName: Story;
|
|
10
|
+
export declare const DarkMode: Story;
|
|
@@ -1,20 +1,23 @@
|
|
|
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
5
|
/** A custom component to render instead of the default invoice component */
|
|
5
6
|
transactionComponent?: React.ReactNode;
|
|
6
7
|
/** Whether to show the search bar */
|
|
7
8
|
showSearchBar?: boolean;
|
|
8
9
|
/** Whether to show the title */
|
|
9
10
|
showTitle?: boolean;
|
|
11
|
+
/** The title to display in the transactions list */
|
|
12
|
+
title?: string;
|
|
10
13
|
/** The columns to display in the transactions list */
|
|
11
|
-
columns?: ("date-and-title" | "state" | "amount" | "download"
|
|
14
|
+
columns?: ("date-and-title" | "state" | "amount" | "download")[];
|
|
12
15
|
/** A custom class name to apply to the component */
|
|
13
16
|
className?: string;
|
|
14
17
|
/** Whether to use a modal for the invoice drawer */
|
|
15
18
|
useModal?: boolean;
|
|
16
19
|
/** Whether to show a shadow around the transactions list */
|
|
17
|
-
shadow?:
|
|
20
|
+
shadow?: ShadowType;
|
|
18
21
|
/** A custom class name to apply to the search bar */
|
|
19
22
|
searchBarClassName?: string;
|
|
20
23
|
/** A function to call when a transaction is clicked */
|
|
@@ -32,9 +35,8 @@ export default function Transactions({ transactionComponent, showSearchBar, show
|
|
|
32
35
|
/** The entity id to pass to the invoice component */
|
|
33
36
|
entityId: string;
|
|
34
37
|
}): import("react/jsx-runtime").JSX.Element;
|
|
35
|
-
export declare function TransactionsDisplay({ transactions, onSearchValueChanged, search,
|
|
38
|
+
export declare function TransactionsDisplay({ transactions, onSearchValueChanged, search, }: {
|
|
36
39
|
transactions: T.Transaction[];
|
|
37
40
|
onSearchValueChanged: (value: string) => void;
|
|
38
41
|
search: string;
|
|
39
|
-
title?: string;
|
|
40
42
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,17 +1,26 @@
|
|
|
1
|
-
import type { StoryObj } from "@storybook/react";
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import Transactions from "./Transactions";
|
|
3
|
-
declare const meta:
|
|
4
|
-
component: typeof Transactions;
|
|
5
|
-
tags: string[];
|
|
6
|
-
};
|
|
3
|
+
declare const meta: Meta<typeof Transactions>;
|
|
7
4
|
export default meta;
|
|
8
5
|
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const basicArgs: {
|
|
7
|
+
token: string;
|
|
8
|
+
entityId: string;
|
|
9
|
+
};
|
|
9
10
|
export declare const Default: Story;
|
|
11
|
+
export declare const Padding0BGRed: Story;
|
|
12
|
+
export declare const NoShadow: Story;
|
|
10
13
|
export declare const WithModal: Story;
|
|
11
|
-
export declare const
|
|
14
|
+
export declare const HideSearchBar: Story;
|
|
15
|
+
export declare const HideTitle: Story;
|
|
16
|
+
export declare const HideTitleAndSearchBar: Story;
|
|
17
|
+
export declare const CustomTitle: Story;
|
|
12
18
|
export declare const Mobile: Story;
|
|
13
19
|
export declare const WithCustomTransactionComponent: Story;
|
|
14
20
|
export declare const WithCustomColumns1: Story;
|
|
15
21
|
export declare const WithCustomColumns2: Story;
|
|
16
22
|
export declare const WithCustomColumns3: Story;
|
|
17
23
|
export declare const WithCustomColumns4: Story;
|
|
24
|
+
export declare const WithCustomColumns5: Story;
|
|
25
|
+
export declare const DarkMode: Story;
|
|
26
|
+
export declare const CustomColors: Story;
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FrontendTransaction as T, TransactionKind } from "@bunnyapp/common";
|
|
3
3
|
import { TransactionListColumnType } from "./transactionsList/TransactionsListDesktop";
|
|
4
|
+
import { ShadowType } from "../../types/shadowType";
|
|
4
5
|
export type TransactionsContextValues = {
|
|
5
6
|
showSearchBar?: boolean;
|
|
6
7
|
showTitle?: boolean;
|
|
8
|
+
title?: string;
|
|
7
9
|
transactionComponent?: React.ReactNode;
|
|
10
|
+
transactionStateRenderer?: (state: string) => React.ReactNode;
|
|
8
11
|
columns: TransactionListColumnType[];
|
|
9
12
|
className?: string;
|
|
10
|
-
shadow?:
|
|
13
|
+
shadow?: ShadowType;
|
|
11
14
|
searchBarClassName?: string;
|
|
12
15
|
useModal?: boolean;
|
|
13
16
|
onTransactionClick?: (transaction: T.Transaction) => void;
|
|
17
|
+
onTransactionDisplayClose?: (transaction: T.Transaction | null) => void;
|
|
14
18
|
suppressTransactionDisplay?: boolean;
|
|
15
19
|
kindsToShow: TransactionKind[];
|
|
16
20
|
style?: React.CSSProperties;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FrontendTransaction as T } from "@bunnyapp/common";
|
|
2
|
-
export type TransactionListColumnType = "date-and-title" | "state" | "amount" | "download"
|
|
2
|
+
export type TransactionListColumnType = "date-and-title" | "state" | "amount" | "download";
|
|
3
3
|
declare const TransactionsListDesktop: ({ transactions, onTransactionClick, }: {
|
|
4
4
|
transactions: T.Transaction[];
|
|
5
5
|
onTransactionClick?: ((transaction: T.Transaction) => void) | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export type PaymentContextValues = {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
onClickCancel?: () => void;
|
|
4
|
+
accountId?: string;
|
|
5
5
|
};
|
|
6
6
|
export declare const PaymentContext: import("react").Context<PaymentContextValues>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare const useSendAcceptQuote: ({ entityId,
|
|
2
|
+
declare const useSendAcceptQuote: ({ entityId, onTokenExpired, quoteId, apiHost, token, }: {
|
|
3
3
|
entityId: string;
|
|
4
|
-
|
|
4
|
+
onTokenExpired?: (() => void) | undefined;
|
|
5
5
|
quoteId?: string | undefined;
|
|
6
6
|
apiHost: string;
|
|
7
7
|
token: string;
|
|
@@ -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>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const handlers: import("msw/lib/core/GraphQLHandler-C5CUIS_N").G[];
|
|
1
|
+
export declare const handlers: (import("msw/lib/core/handlers/HttpHandler").HttpHandler | import("msw/lib/core/GraphQLHandler-C5CUIS_N").G)[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ShadowType = "shadow-none" | "shadow-sm" | "shadow-md" | "shadow-lg" | "shadow-xl";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import React$1 from 'react';
|
|
3
4
|
import { FrontendTransaction, FormattedInvoice, Quote as Quote$1, PriceList, PaymentMethod as PaymentMethod$1, TransactionKind } from '@bunnyapp/common';
|
|
4
5
|
import { QueryClient } from '@tanstack/react-query';
|
|
5
|
-
import react from 'react';
|
|
6
6
|
import * as _tanstack_react_query_build_legacy_types from '@tanstack/react-query/build/legacy/types';
|
|
7
7
|
import { GraphQLClient } from 'graphql-request';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
type ShadowType = "shadow-none" | "shadow-sm" | "shadow-md" | "shadow-lg" | "shadow-xl";
|
|
10
|
+
|
|
11
|
+
type InvoiceQuoteContextProps = {
|
|
10
12
|
id?: string;
|
|
11
|
-
invoiceQuoteViewComponent?:
|
|
13
|
+
invoiceQuoteViewComponent?: React$1.ReactNode;
|
|
12
14
|
backButtonName?: string;
|
|
13
15
|
onBackButtonClick?: () => void;
|
|
14
16
|
onInvoiceDownloadError?: () => void;
|
|
15
17
|
onPaymentSuccess?: (savePaymentMethod?: boolean) => void;
|
|
16
18
|
entityId: string;
|
|
17
|
-
|
|
19
|
+
shadow?: ShadowType;
|
|
20
|
+
className?: string;
|
|
21
|
+
hideDownloadButton?: boolean;
|
|
22
|
+
};
|
|
23
|
+
declare function Invoice({ id, invoiceQuoteViewComponent, backButtonName, onBackButtonClick, onInvoiceDownloadError, onPaymentSuccess, entityId, shadow, className, hideDownloadButton, }: InvoiceQuoteContextProps): react_jsx_runtime.JSX.Element;
|
|
18
24
|
|
|
19
25
|
declare global {
|
|
20
26
|
interface Window {
|
|
@@ -24,26 +30,27 @@ declare global {
|
|
|
24
30
|
}
|
|
25
31
|
}
|
|
26
32
|
|
|
27
|
-
declare function Quote({ entityId,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}): react_jsx_runtime.JSX.Element;
|
|
33
|
+
declare function Quote({ id, invoiceQuoteViewComponent, onInvoiceDownloadError, onPaymentSuccess, entityId, shadow, className, hideDownloadButton, }: InvoiceQuoteContextProps): react_jsx_runtime.JSX.Element;
|
|
34
|
+
|
|
35
|
+
type TransactionListColumnType = "date-and-title" | "state" | "amount" | "download";
|
|
31
36
|
|
|
32
|
-
declare function Quotes({ className, columns, entityId, filter, noQuotesMessage, onQuoteClick, quoteComponent, searchBarClassName, shadow, showSearchBar, showTitle, style, suppressQuoteDisplay, useModal, }: {
|
|
37
|
+
declare function Quotes({ className, columns, entityId, filter, noQuotesMessage, onQuoteClick, quoteComponent, searchBarClassName, shadow, showSearchBar, showTitle, title, style, suppressQuoteDisplay, useModal, }: {
|
|
33
38
|
/** A custom component to render instead of the default invoice component */
|
|
34
39
|
quoteComponent?: React.ReactNode;
|
|
35
40
|
/** Whether to show the search bar */
|
|
36
41
|
showSearchBar?: boolean;
|
|
37
42
|
/** Whether to show the title */
|
|
38
43
|
showTitle?: boolean;
|
|
39
|
-
/** The
|
|
40
|
-
|
|
44
|
+
/** The title to display in the quotes list */
|
|
45
|
+
title?: string;
|
|
46
|
+
/** The columns to display in the quotes list */
|
|
47
|
+
columns?: TransactionListColumnType[];
|
|
41
48
|
/** A custom class name to apply to the component */
|
|
42
49
|
className?: string;
|
|
43
50
|
/** Whether to use a modal for the invoice drawer */
|
|
44
51
|
useModal?: boolean;
|
|
45
52
|
/** Whether to show a shadow around the transactions list */
|
|
46
|
-
shadow?:
|
|
53
|
+
shadow?: ShadowType;
|
|
47
54
|
/** A custom class name to apply to the search bar */
|
|
48
55
|
searchBarClassName?: string;
|
|
49
56
|
/** A function to call when a quote is clicked */
|
|
@@ -59,10 +66,12 @@ declare function Quotes({ className, columns, entityId, filter, noQuotesMessage,
|
|
|
59
66
|
entityId: string;
|
|
60
67
|
}): react_jsx_runtime.JSX.Element;
|
|
61
68
|
|
|
62
|
-
declare
|
|
69
|
+
declare const PaymentMethod: ({ entityId, className, shadow, cardEnabled, }: {
|
|
63
70
|
entityId: string;
|
|
64
|
-
|
|
65
|
-
|
|
71
|
+
className?: string | undefined;
|
|
72
|
+
shadow?: ShadowType | undefined;
|
|
73
|
+
cardEnabled?: boolean | undefined;
|
|
74
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
66
75
|
|
|
67
76
|
type CheckoutProps = {
|
|
68
77
|
invoice?: FormattedInvoice;
|
|
@@ -88,39 +97,49 @@ declare const Checkout: ({ entityId, onCancel, onSuccess, onFail, invoice, open,
|
|
|
88
97
|
|
|
89
98
|
declare const getQuoteAmountDue: (quote: Quote$1) => number;
|
|
90
99
|
|
|
91
|
-
declare function Signup({ companyName, entityId, priceListCode, returnUrl, }: {
|
|
100
|
+
declare function Signup({ companyName, entityId, priceListCode, returnUrl, isCardEnabled, className, shadow, style, }: {
|
|
92
101
|
companyName: string;
|
|
93
102
|
entityId: string;
|
|
94
103
|
priceListCode: string;
|
|
95
104
|
returnUrl?: string;
|
|
105
|
+
/** Whether or not to display signup within a card */
|
|
106
|
+
isCardEnabled?: boolean;
|
|
107
|
+
/** A custom class name to apply to the component */
|
|
108
|
+
className?: string;
|
|
109
|
+
/** The shadow level to apply to the component */
|
|
110
|
+
shadow?: ShadowType;
|
|
111
|
+
/** A custom style to apply to the component */
|
|
112
|
+
style?: React.CSSProperties;
|
|
96
113
|
}): react_jsx_runtime.JSX.Element;
|
|
97
114
|
|
|
98
|
-
declare function BunnyProvider({ accountId, children, darkMode,
|
|
115
|
+
declare function BunnyProvider({ accountId, children, darkMode, queryClient, apiHost, token, window, onTokenExpired, }: {
|
|
99
116
|
accountId?: string;
|
|
100
117
|
children: React.ReactNode;
|
|
101
118
|
darkMode?: boolean;
|
|
102
|
-
onErrorNavigate?: () => void;
|
|
103
119
|
queryClient?: QueryClient;
|
|
104
120
|
apiHost: string;
|
|
105
121
|
token: string;
|
|
106
122
|
window: Window;
|
|
123
|
+
onTokenExpired?: () => void;
|
|
107
124
|
}): react_jsx_runtime.JSX.Element;
|
|
108
125
|
|
|
109
|
-
declare function Transactions({ transactionComponent, showSearchBar, showTitle, columns, className, shadow, searchBarClassName, useModal, onTransactionClick, suppressTransactionDisplay, kindsToShow, style, filter, noTransactionsMessage, entityId, }: {
|
|
126
|
+
declare function Transactions({ transactionComponent, showSearchBar, showTitle, title, columns, className, shadow, searchBarClassName, useModal, onTransactionClick, suppressTransactionDisplay, kindsToShow, style, filter, noTransactionsMessage, entityId, }: {
|
|
110
127
|
/** A custom component to render instead of the default invoice component */
|
|
111
|
-
transactionComponent?:
|
|
128
|
+
transactionComponent?: React$1.ReactNode;
|
|
112
129
|
/** Whether to show the search bar */
|
|
113
130
|
showSearchBar?: boolean;
|
|
114
131
|
/** Whether to show the title */
|
|
115
132
|
showTitle?: boolean;
|
|
133
|
+
/** The title to display in the transactions list */
|
|
134
|
+
title?: string;
|
|
116
135
|
/** The columns to display in the transactions list */
|
|
117
|
-
columns?: ("date-and-title" | "state" | "amount" | "download"
|
|
136
|
+
columns?: ("date-and-title" | "state" | "amount" | "download")[];
|
|
118
137
|
/** A custom class name to apply to the component */
|
|
119
138
|
className?: string;
|
|
120
139
|
/** Whether to use a modal for the invoice drawer */
|
|
121
140
|
useModal?: boolean;
|
|
122
141
|
/** Whether to show a shadow around the transactions list */
|
|
123
|
-
shadow?:
|
|
142
|
+
shadow?: ShadowType;
|
|
124
143
|
/** A custom class name to apply to the search bar */
|
|
125
144
|
searchBarClassName?: string;
|
|
126
145
|
/** A function to call when a transaction is clicked */
|
|
@@ -130,7 +149,7 @@ declare function Transactions({ transactionComponent, showSearchBar, showTitle,
|
|
|
130
149
|
/** The kinds of transactions to show */
|
|
131
150
|
kindsToShow?: TransactionKind[];
|
|
132
151
|
/** A custom style to apply to the component */
|
|
133
|
-
style?:
|
|
152
|
+
style?: React$1.CSSProperties;
|
|
134
153
|
/** A filter to apply to the transactions. Docs on filter: https://docs.bunny.com/developer/getting-started/using-filters-in-queries */
|
|
135
154
|
filter?: string;
|
|
136
155
|
/** Message to display when there are no transactions */
|
|
@@ -139,14 +158,15 @@ declare function Transactions({ transactionComponent, showSearchBar, showTitle,
|
|
|
139
158
|
entityId: string;
|
|
140
159
|
}): react_jsx_runtime.JSX.Element;
|
|
141
160
|
|
|
142
|
-
declare const Subscriptions: ({ companyName, entityId, gap, shadow, showTitle, }: {
|
|
161
|
+
declare const Subscriptions: ({ companyName, entityId, gap, shadow, showTitle, className, }: {
|
|
143
162
|
companyName: string;
|
|
144
163
|
entityId: string;
|
|
145
164
|
gap?: number | undefined;
|
|
146
165
|
shadow?: "none" | "lg" | "md" | "sm" | undefined;
|
|
147
166
|
showTitle?: boolean | undefined;
|
|
167
|
+
className?: string | undefined;
|
|
148
168
|
}) => react_jsx_runtime.JSX.Element;
|
|
149
169
|
|
|
150
|
-
declare const usePaymentMethod: (graphQLClient: GraphQLClient) => _tanstack_react_query_build_legacy_types.UseQueryResult<any, Error>;
|
|
170
|
+
declare const usePaymentMethod: (graphQLClient: GraphQLClient, accountId?: string) => _tanstack_react_query_build_legacy_types.UseQueryResult<any, Error>;
|
|
151
171
|
|
|
152
172
|
export { BunnyProvider, Checkout, Invoice, PaymentMethod, Quote, Quotes, Signup, Subscriptions, Transactions, getQuoteAmountDue, usePaymentMethod };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bunnyapp/components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"description": "Components from the Bunny portal to embed Bunny UI functionality into your application.",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"vite": "^5.4.11"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"@bunnyapp/common": "^1.0.
|
|
64
|
+
"@bunnyapp/common": "^1.0.38",
|
|
65
65
|
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
|
66
66
|
"@fortawesome/free-brands-svg-icons": "^6.7.2",
|
|
67
67
|
"@fortawesome/free-regular-svg-icons": "^6.7.2",
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { PluginFormProps } from "../PaymentFormTypes";
|
|
2
|
-
export declare const formatFinixError: (response: any) => any;
|
|
3
|
-
declare const FinixForm: ({ invoice, isSaving, onFail, onPaymentSuccess, plugin, quote, setIsSaving, entityId, }: PluginFormProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
4
|
-
export default FinixForm;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { PluginFormProps } from "./PaymentFormTypes";
|
|
2
|
-
declare const FinixAchPayment: ({ invoice, isSaving, onFail, onPaymentSuccess, plugin, quote, setIsSaving, entityId, }: PluginFormProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
3
|
-
export default FinixAchPayment;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { PaymentMethodFormProps } from "./PaymentFormTypes";
|
|
2
|
-
declare const PaymentMethodForm: ({ entityId, invoice, isPlugin, isSaving, onFail, onPaymentSuccess, paymentMethod, quote, setIsSaving, }: PaymentMethodFormProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
3
|
-
export default PaymentMethodForm;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { PaymentMethod, PluginData } from "@bunnyapp/common";
|
|
2
|
-
declare const PaymentOption: ({ selected, paymentOption, onClick, name, }: {
|
|
3
|
-
onClick: (paymentMethod: PluginData | PaymentMethod) => void;
|
|
4
|
-
selected: boolean;
|
|
5
|
-
paymentOption: PluginData | PaymentMethod;
|
|
6
|
-
name: string;
|
|
7
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export default PaymentOption;
|
package/dist/cjs/src/components/PaymentForm/StoredPaymentMethod/StoredPaymentMethodForm.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { StoredPaymentMethodFormProps } from "../PaymentFormTypes";
|
|
2
|
-
declare const StoredPaymentMethodForm: ({ isSaving, invoice, onPaymentSuccess, paymentMethod, quote, setIsSaving, }: StoredPaymentMethodFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
export default StoredPaymentMethodForm;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as StripeForm } from "./StripeForm";
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import './button.css';
|
|
2
|
-
export interface ButtonProps {
|
|
3
|
-
/** Is this the principal call to action on the page? */
|
|
4
|
-
primary?: boolean;
|
|
5
|
-
/** What background color to use */
|
|
6
|
-
backgroundColor?: string;
|
|
7
|
-
/** How large should the button be? */
|
|
8
|
-
size?: 'small' | 'medium' | 'large';
|
|
9
|
-
/** Button contents */
|
|
10
|
-
label: string;
|
|
11
|
-
/** Optional click handler */
|
|
12
|
-
onClick?: () => void;
|
|
13
|
-
}
|
|
14
|
-
/** Primary UI component for user interaction */
|
|
15
|
-
export declare const Button: ({ primary, size, backgroundColor, label, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Button } from './Button';
|
|
3
|
-
declare const meta: Meta<typeof Button>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof Button>;
|
|
6
|
-
export declare const Primary: Story;
|
|
7
|
-
export declare const Secondary: Story;
|
|
8
|
-
export declare const Large: Story;
|
|
9
|
-
export declare const Small: Story;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import './header.css';
|
|
2
|
-
type User = {
|
|
3
|
-
name: string;
|
|
4
|
-
};
|
|
5
|
-
export interface HeaderProps {
|
|
6
|
-
user?: User;
|
|
7
|
-
onLogin?: () => void;
|
|
8
|
-
onLogout?: () => void;
|
|
9
|
-
onCreateAccount?: () => void;
|
|
10
|
-
}
|
|
11
|
-
export declare const Header: ({ user, onLogin, onLogout, onCreateAccount }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Header } from './Header';
|
|
3
|
-
declare const meta: Meta<typeof Header>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof Header>;
|
|
6
|
-
export declare const LoggedIn: Story;
|
|
7
|
-
export declare const LoggedOut: Story;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { Page } from './Page';
|
|
3
|
-
declare const meta: Meta<typeof Page>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof Page>;
|
|
6
|
-
export declare const LoggedOut: Story;
|
|
7
|
-
export declare const LoggedIn: Story;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { PluginFormProps } from "../PaymentFormTypes";
|
|
2
|
-
export declare const formatFinixError: (response: any) => any;
|
|
3
|
-
declare const FinixForm: ({ invoice, isSaving, onFail, onPaymentSuccess, plugin, quote, setIsSaving, entityId, }: PluginFormProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
4
|
-
export default FinixForm;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { PluginFormProps } from "./PaymentFormTypes";
|
|
2
|
-
declare const FinixAchPayment: ({ invoice, isSaving, onFail, onPaymentSuccess, plugin, quote, setIsSaving, entityId, }: PluginFormProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
3
|
-
export default FinixAchPayment;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { PaymentMethodFormProps } from "./PaymentFormTypes";
|
|
2
|
-
declare const PaymentMethodForm: ({ entityId, invoice, isPlugin, isSaving, onFail, onPaymentSuccess, paymentMethod, quote, setIsSaving, }: PaymentMethodFormProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
3
|
-
export default PaymentMethodForm;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { PaymentMethod, PluginData } from "@bunnyapp/common";
|
|
2
|
-
declare const PaymentOption: ({ selected, paymentOption, onClick, name, }: {
|
|
3
|
-
onClick: (paymentMethod: PluginData | PaymentMethod) => void;
|
|
4
|
-
selected: boolean;
|
|
5
|
-
paymentOption: PluginData | PaymentMethod;
|
|
6
|
-
name: string;
|
|
7
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export default PaymentOption;
|
package/dist/esm/src/components/PaymentForm/StoredPaymentMethod/StoredPaymentMethodForm.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { StoredPaymentMethodFormProps } from "../PaymentFormTypes";
|
|
2
|
-
declare const StoredPaymentMethodForm: ({ isSaving, invoice, onPaymentSuccess, paymentMethod, quote, setIsSaving, }: StoredPaymentMethodFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
export default StoredPaymentMethodForm;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as StripeForm } from "./StripeForm";
|