@bunnyapp/components 1.0.68 → 1.0.72

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.
Files changed (62) hide show
  1. package/dist/cjs/index.js +520 -410
  2. package/dist/cjs/src/components/BillingDetails/BillingDetailsForm.d.ts +1 -1
  3. package/dist/cjs/src/components/Checkout/Checkout.d.ts +1 -3
  4. package/dist/cjs/src/components/Checkout/checkoutUtils.d.ts +1 -1
  5. package/dist/cjs/src/components/PaymentForm/PaymentForm.d.ts +2 -1
  6. package/dist/cjs/src/components/Quote/AcceptQuoteModal.d.ts +1 -1
  7. package/dist/cjs/src/components/Quote/Quote.stories.d.ts +5 -5
  8. package/dist/cjs/src/components/Signup/CheckoutSummary.d.ts +11 -0
  9. package/dist/cjs/src/components/Signup/PaymentForms.d.ts +6 -0
  10. package/dist/cjs/src/components/Signup/Signup.d.ts +1 -3
  11. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanManager.d.ts +0 -4
  12. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/CheckoutBarSummarySection.d.ts +2 -1
  13. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/PlanPickerCheckoutBar.d.ts +1 -1
  14. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/BillingPeriodSelector.d.ts +2 -2
  15. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerMobile/PriceListCardMobile.d.ts +1 -1
  16. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCardDescription.d.ts +1 -1
  17. package/dist/cjs/src/components/Subscriptions/Subscriptions.stories.d.ts +2 -2
  18. package/dist/cjs/src/components/Subscriptions/SubscriptionsContext.d.ts +2 -1
  19. package/dist/cjs/src/components/Subscriptions/quantityChangeDrawer/QuantityInput.d.ts +1 -1
  20. package/dist/cjs/src/components/Transactions/Transactions.d.ts +5 -5
  21. package/dist/cjs/src/contexts/PaymentContext.d.ts +1 -1
  22. package/dist/cjs/src/graphql/mutations/accountSignup.d.ts +1 -2
  23. package/dist/cjs/src/graphql/mutations/quoteAccountSignup.d.ts +3 -2
  24. package/dist/cjs/src/graphql/mutations/quoteChangeAddCoupon.d.ts +8 -0
  25. package/dist/cjs/src/graphql/mutations/quoteChangeRemoveCoupon.d.ts +8 -0
  26. package/dist/cjs/src/hooks/quotes/useSendAcceptQuote.d.ts +1 -2
  27. package/dist/cjs/src/hooks/usePaymentPlugins.d.ts +24 -3
  28. package/dist/cjs/src/styles/constants.d.ts +0 -3
  29. package/dist/esm/index.js +526 -397
  30. package/dist/esm/src/components/BillingDetails/BillingDetailsForm.d.ts +1 -1
  31. package/dist/esm/src/components/Checkout/Checkout.d.ts +1 -3
  32. package/dist/esm/src/components/Checkout/checkoutUtils.d.ts +1 -1
  33. package/dist/esm/src/components/PaymentForm/PaymentForm.d.ts +2 -1
  34. package/dist/esm/src/components/Quote/AcceptQuoteModal.d.ts +1 -1
  35. package/dist/esm/src/components/Quote/Quote.stories.d.ts +5 -5
  36. package/dist/esm/src/components/Signup/CheckoutSummary.d.ts +11 -0
  37. package/dist/esm/src/components/Signup/PaymentForms.d.ts +6 -0
  38. package/dist/esm/src/components/Signup/Signup.d.ts +1 -3
  39. package/dist/esm/src/components/Subscriptions/PlanManager/PlanManager.d.ts +0 -4
  40. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/CheckoutBarSummarySection.d.ts +2 -1
  41. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/PlanPickerCheckoutBar.d.ts +1 -1
  42. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/BillingPeriodSelector.d.ts +2 -2
  43. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerMobile/PriceListCardMobile.d.ts +1 -1
  44. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCardDescription.d.ts +1 -1
  45. package/dist/esm/src/components/Subscriptions/Subscriptions.stories.d.ts +2 -2
  46. package/dist/esm/src/components/Subscriptions/SubscriptionsContext.d.ts +2 -1
  47. package/dist/esm/src/components/Subscriptions/quantityChangeDrawer/QuantityInput.d.ts +1 -1
  48. package/dist/esm/src/components/Transactions/Transactions.d.ts +5 -5
  49. package/dist/esm/src/contexts/PaymentContext.d.ts +1 -1
  50. package/dist/esm/src/graphql/mutations/accountSignup.d.ts +1 -2
  51. package/dist/esm/src/graphql/mutations/quoteAccountSignup.d.ts +3 -2
  52. package/dist/esm/src/graphql/mutations/quoteChangeAddCoupon.d.ts +8 -0
  53. package/dist/esm/src/graphql/mutations/quoteChangeRemoveCoupon.d.ts +8 -0
  54. package/dist/esm/src/hooks/quotes/useSendAcceptQuote.d.ts +1 -2
  55. package/dist/esm/src/hooks/usePaymentPlugins.d.ts +24 -3
  56. package/dist/esm/src/styles/constants.d.ts +0 -3
  57. package/dist/index.d.ts +3 -4
  58. package/package.json +4 -6
  59. package/dist/cjs/src/graphql/mutations/quoteAddCoupon.d.ts +0 -8
  60. package/dist/cjs/src/styles/AntdOverrides.d.ts +0 -3
  61. package/dist/esm/src/graphql/mutations/quoteAddCoupon.d.ts +0 -8
  62. package/dist/esm/src/styles/AntdOverrides.d.ts +0 -3
@@ -1,4 +1,4 @@
1
- import "../../styles/index.less";
1
+ import '../../styles/index.less';
2
2
  export default function BillingDetailsSection({ hidePaymentMethodForm, countryListFilter, }: {
3
3
  hidePaymentMethodForm: boolean;
4
4
  countryListFilter?: (country: {
@@ -1,9 +1,7 @@
1
1
  import { PaymentMethod } from '@bunnyapp/common';
2
2
  import { CheckoutProps } from '../PaymentForm/PaymentFormTypes';
3
3
  interface CheckoutComponentProps extends CheckoutProps {
4
- isMobile: boolean;
5
- token?: string;
6
4
  storedPaymentMethod?: PaymentMethod;
7
5
  }
8
- declare const Checkout: ({ onCancel, onSuccess, onFail, invoice, open, quote, selectedPriceList, token, }: CheckoutComponentProps) => import("react/jsx-runtime").JSX.Element | null;
6
+ declare const Checkout: ({ onCancel, onSuccess, onFail, invoice, open, quote, selectedPriceList, }: CheckoutComponentProps) => import("react/jsx-runtime").JSX.Element | null;
9
7
  export default Checkout;
@@ -1,2 +1,2 @@
1
- import { Quote } from "@bunnyapp/common";
1
+ import { Quote } from '@bunnyapp/common';
2
2
  export declare const getQuoteAmountDue: (quote: Quote) => number;
@@ -1,5 +1,5 @@
1
1
  import { FormattedInvoice, PluginData, Quote } from '@bunnyapp/common';
2
- export declare const PaymentForm: ({ invoice, onFail, onPaymentSuccess, onPaymentHoldSuccess, quote, accountId, onSavePaymentMethod, onRemovePaymentMethod, onSetDefaultPaymentMethod, overrideToken, customCheckoutFunction, currencyId: currencyIdFromProps, paymentHoldOptions, }: {
2
+ export declare const PaymentForm: ({ invoice, onFail, onPaymentSuccess, onPaymentHoldSuccess, quote, accountId, onSavePaymentMethod, onRemovePaymentMethod, onSetDefaultPaymentMethod, entityId, overrideToken, customCheckoutFunction, currencyId: currencyIdFromProps, paymentHoldOptions, }: {
3
3
  invoice?: FormattedInvoice | undefined;
4
4
  quote?: Quote | undefined;
5
5
  onFail: (error: any) => void;
@@ -9,6 +9,7 @@ export declare const PaymentForm: ({ invoice, onFail, onPaymentSuccess, onPaymen
9
9
  onRemovePaymentMethod?: (() => void) | undefined;
10
10
  onSetDefaultPaymentMethod?: (() => void) | undefined;
11
11
  accountId?: string | undefined;
12
+ entityId?: string | undefined;
12
13
  overrideToken?: string | undefined;
13
14
  customCheckoutFunction?: ((plugin: PluginData | undefined) => Promise<any>) | undefined;
14
15
  currencyId?: string | undefined;
@@ -1,4 +1,4 @@
1
- import { FormattedQuote } from "@bunnyapp/common";
1
+ import { FormattedQuote } from '@bunnyapp/common';
2
2
  declare const AcceptQuoteModal: ({ acceptBoxVisible, formattedQuote, sendAccept, setAcceptBoxVisible, setIsAccepting, isSendAcceptPending, }: {
3
3
  acceptBoxVisible: boolean;
4
4
  formattedQuote: FormattedQuote;
@@ -8,11 +8,11 @@ export declare const Default: import("@storybook/core/csf").StoryAnnotations<imp
8
8
  }, {
9
9
  [x: string]: any;
10
10
  className?: any;
11
- id?: any;
12
11
  backButtonName?: any;
13
12
  onBackButtonClick?: any;
14
13
  shadow?: any;
15
14
  hideDownloadButton?: any;
15
+ id?: any;
16
16
  onPaymentSuccess?: any;
17
17
  invoiceQuoteViewComponent?: any;
18
18
  onInvoiceDownloadError?: any;
@@ -24,11 +24,11 @@ export declare const NoShadow: import("@storybook/core/csf").StoryAnnotations<im
24
24
  }, {
25
25
  [x: string]: any;
26
26
  className?: any;
27
- id?: any;
28
27
  backButtonName?: any;
29
28
  onBackButtonClick?: any;
30
29
  shadow?: any;
31
30
  hideDownloadButton?: any;
31
+ id?: any;
32
32
  onPaymentSuccess?: any;
33
33
  invoiceQuoteViewComponent?: any;
34
34
  onInvoiceDownloadError?: any;
@@ -40,11 +40,11 @@ export declare const Mobile: import("@storybook/core/csf").StoryAnnotations<impo
40
40
  }, {
41
41
  [x: string]: any;
42
42
  className?: any;
43
- id?: any;
44
43
  backButtonName?: any;
45
44
  onBackButtonClick?: any;
46
45
  shadow?: any;
47
46
  hideDownloadButton?: any;
47
+ id?: any;
48
48
  onPaymentSuccess?: any;
49
49
  invoiceQuoteViewComponent?: any;
50
50
  onInvoiceDownloadError?: any;
@@ -56,11 +56,11 @@ export declare const CustomClassName: import("@storybook/core/csf").StoryAnnotat
56
56
  }, {
57
57
  [x: string]: any;
58
58
  className?: any;
59
- id?: any;
60
59
  backButtonName?: any;
61
60
  onBackButtonClick?: any;
62
61
  shadow?: any;
63
62
  hideDownloadButton?: any;
63
+ id?: any;
64
64
  onPaymentSuccess?: any;
65
65
  invoiceQuoteViewComponent?: any;
66
66
  onInvoiceDownloadError?: any;
@@ -75,11 +75,11 @@ export declare const DarkMode: import("@storybook/core/csf").StoryAnnotations<im
75
75
  }, {
76
76
  [x: string]: any;
77
77
  className?: any;
78
- id?: any;
79
78
  backButtonName?: any;
80
79
  onBackButtonClick?: any;
81
80
  shadow?: any;
82
81
  hideDownloadButton?: any;
82
+ id?: any;
83
83
  onPaymentSuccess?: any;
84
84
  invoiceQuoteViewComponent?: any;
85
85
  onInvoiceDownloadError?: any;
@@ -0,0 +1,11 @@
1
+ import '../../styles/index.less';
2
+ import { PriceList, Quote } from '@bunnyapp/common';
3
+ export default function CheckoutSummary({ quote, className, onAddCoupon, onRemoveCoupon, isRemovingCoupon, priceListData, isAddingCoupon, }: {
4
+ quote: Quote;
5
+ className?: string;
6
+ onAddCoupon: (couponCode: string) => void;
7
+ onRemoveCoupon: (couponCode: string) => void;
8
+ isRemovingCoupon: boolean;
9
+ priceListData?: PriceList;
10
+ isAddingCoupon: boolean;
11
+ }): import("react/jsx-runtime").JSX.Element;
@@ -14,4 +14,10 @@ export type FormData = {
14
14
  lastName: string;
15
15
  email: string;
16
16
  accountName: string;
17
+ billingCountry: string;
18
+ billingState: string;
19
+ billingCity: string;
20
+ billingZip: string;
21
+ billingStreet: string;
22
+ taxNumber: string;
17
23
  };
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import '../../styles/index.less';
3
3
  import { ShadowType } from '../../types/shadowType';
4
- export default function Signup({ companyName, priceListCode, returnUrl, couponCode, className, shadow, style, entityId, }: {
4
+ export default function Signup({ companyName, priceListCode, returnUrl, couponCode, className, shadow, style, }: {
5
5
  /** The company name to display on the signup page */
6
6
  companyName: string;
7
7
  /** The price list code to use for the signup */
@@ -16,6 +16,4 @@ export default function Signup({ companyName, priceListCode, returnUrl, couponCo
16
16
  shadow?: ShadowType;
17
17
  /** A custom style to apply to the component */
18
18
  style?: React.CSSProperties;
19
- /** The entity ID to use for the signup */
20
- entityId: string;
21
19
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,3 @@
1
- export type EditingQuoteDataType = {
2
- id?: string;
3
- isTrial?: boolean;
4
- };
5
1
  declare const PlanManager: ({ onChangePlanCancel, handlePortalErrors, }: {
6
2
  onChangePlanCancel: () => void;
7
3
  handlePortalErrors?: ((error: any) => void) | undefined;
@@ -1,4 +1,5 @@
1
- import { PriceList, Quote, QuotePreviewData, Subscription } from '@bunnyapp/common';
1
+ import { PriceList, Quote, Subscription } from '@bunnyapp/common';
2
+ import { QuotePreviewData } from '../PlanPicker';
2
3
  declare const CheckoutBarSummarySection: ({ open, quote, selectedPriceList, onClickCheckout, upgradingSubscription, quotePreviewData, }: {
3
4
  open: boolean;
4
5
  quote?: Quote | undefined;
@@ -1,4 +1,4 @@
1
- import { EditingQuoteDataType } from '../../PlanManager';
1
+ import { EditingQuoteDataType } from '../../../Subscriptions';
2
2
  declare const PlanPickerCheckoutBarWrapper: ({ editingQuote, setEditingQuoteData, handlePortalErrors, onCheckoutSuccess, }: {
3
3
  editingQuote?: EditingQuoteDataType | undefined;
4
4
  setEditingQuoteData?: ((quoteId?: string, isTrial?: boolean) => void) | undefined;
@@ -1,5 +1,5 @@
1
- import { BillingPeriod, Product } from "@bunnyapp/common";
2
- import { PeriodMonths } from "../../../../../utils/pricePickerUtils";
1
+ import { BillingPeriod, Product } from '@bunnyapp/common';
2
+ import { PeriodMonths } from '../../../../../utils/pricePickerUtils';
3
3
  declare const BillingPeriodSelector: ({ availableBillingPeriods, onChangeBillingPeriod, products, selectedBillingPeriod, selectedProduct, onChangeProduct, }: {
4
4
  availableBillingPeriods?: PeriodMonths[] | undefined;
5
5
  onChangeBillingPeriod: (billingPeriod: BillingPeriod) => void;
@@ -1,4 +1,4 @@
1
- import { Feature, PriceList, Subscription } from "@bunnyapp/common";
1
+ import { Feature, PriceList, Subscription } from '@bunnyapp/common';
2
2
  declare const PriceListCardMobile: ({ description, disableOnClick, feature, isPriceListCurrentSubscription, isSelected, onClick, priceList, subscriptionPlan, trialRemainingDays, }: {
3
3
  description: string;
4
4
  disableOnClick: boolean;
@@ -1,4 +1,4 @@
1
1
  declare const PriceListCardDescription: ({ description }: {
2
2
  description?: string | undefined;
3
- }) => import("react/jsx-runtime").JSX.Element | null;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
4
  export default PriceListCardDescription;
@@ -1,5 +1,5 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import Subscriptions from "./Subscriptions";
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import Subscriptions from './Subscriptions';
3
3
  declare const meta: Meta<typeof Subscriptions>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof meta>;
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { QuotePreviewData, Subscription } from '@bunnyapp/common';
2
+ import { Subscription } from '@bunnyapp/common';
3
+ import { QuotePreviewData } from './PlanManager/PlanPicker/PlanPicker';
3
4
  export type SubscriptionsContextValues = {
4
5
  gap?: number;
5
6
  shadow?: 'none' | 'sm' | 'md' | 'lg';
@@ -1,4 +1,4 @@
1
- import { Quote, Subscription, SubscriptionCharge } from "@bunnyapp/common";
1
+ import { Quote, Subscription, SubscriptionCharge } from '@bunnyapp/common';
2
2
  export type EditingSubscriptionType = {
3
3
  chargeId: string;
4
4
  chargeIndex: number;
@@ -1,8 +1,8 @@
1
- import React from "react";
2
- import { FrontendTransaction as T, TransactionKind } from "@bunnyapp/common";
3
- import { ShadowType } from "../../types/shadowType";
4
- import { TransactionListColumnType } from "./transactionsList/TransactionsListDesktop";
5
- import { TransactionDateType } from "./TransactionsListContext";
1
+ import React from 'react';
2
+ import { FrontendTransaction as T, TransactionKind } from '@bunnyapp/common';
3
+ import { ShadowType } from '../../types/shadowType';
4
+ import { TransactionListColumnType } from './transactionsList/TransactionsListDesktop';
5
+ import { TransactionDateType } from './TransactionsListContext';
6
6
  export default function Transactions({ transactionComponent, showSearchBar, showTitle, title, columns, className, shadow, searchBarClassName, useModal, onTransactionClick, suppressTransactionDisplay, kindsToShow, style, filter, noTransactionsMessage, filterTransactions, sortTransactions, transactionDateType, }: {
7
7
  /** A custom component to render instead of the default invoice component */
8
8
  transactionComponent?: React.ReactNode;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { PaymentMethod, PluginData } from "@bunnyapp/common";
2
+ import { PaymentMethod, PluginData } from '@bunnyapp/common';
3
3
  export type PaymentContextValues = {
4
4
  onClickCancel?: () => void;
5
5
  accountId?: string;
@@ -1,4 +1,4 @@
1
- declare const accountSignup: ({ token, apiHost, accountId, quoteId, paymentToken, paymentMethodId, pluginId, priceListCode, entityId, }: {
1
+ declare const accountSignup: ({ token, apiHost, accountId, quoteId, paymentToken, paymentMethodId, pluginId, priceListCode, }: {
2
2
  token: string;
3
3
  apiHost: string;
4
4
  accountId: string;
@@ -7,6 +7,5 @@ declare const accountSignup: ({ token, apiHost, accountId, quoteId, paymentToken
7
7
  paymentMethodId?: string | undefined;
8
8
  pluginId: string;
9
9
  priceListCode: string;
10
- entityId: string;
11
10
  }) => Promise<any>;
12
11
  export default accountSignup;
@@ -1,14 +1,15 @@
1
+ import BillingDetails from '../../types/billingDetails';
1
2
  type BillingContact = {
2
3
  firstName: string;
3
4
  lastName: string;
4
5
  email: string;
5
6
  };
6
- declare const quoteAccountSignup: ({ token, apiHost, priceListCode, accountName, billingContact, entityId, }: {
7
+ declare const quoteAccountSignup: ({ token, apiHost, priceListCode, accountName, billingContact, billingDetails, }: {
7
8
  token?: string | undefined;
8
9
  apiHost: string;
9
10
  priceListCode: string;
10
11
  accountName: string;
11
12
  billingContact: BillingContact;
12
- entityId: string;
13
+ billingDetails?: BillingDetails | undefined;
13
14
  }) => Promise<any>;
14
15
  export default quoteAccountSignup;
@@ -0,0 +1,8 @@
1
+ import { Quote } from '@bunnyapp/common';
2
+ declare const quoteChangeAddCoupon: ({ quoteChangeId, couponCode, token, apiHost, }: {
3
+ quoteChangeId: string;
4
+ couponCode: string;
5
+ token?: string | undefined;
6
+ apiHost: string;
7
+ }) => Promise<Quote>;
8
+ export default quoteChangeAddCoupon;
@@ -0,0 +1,8 @@
1
+ import { Quote } from '@bunnyapp/common';
2
+ declare const quoteChangeRemoveCoupon: ({ quoteChangeId, couponCode, token, apiHost, }: {
3
+ quoteChangeId: string;
4
+ couponCode: string;
5
+ token?: string | undefined;
6
+ apiHost: string;
7
+ }) => Promise<Quote>;
8
+ export default quoteChangeRemoveCoupon;
@@ -1,6 +1,5 @@
1
1
  /// <reference types="react" />
2
- declare const useSendAcceptQuote: ({ onTokenExpired, quoteId, apiHost, token, }: {
3
- onTokenExpired?: (() => void) | undefined;
2
+ declare const useSendAcceptQuote: ({ quoteId, apiHost, token, }: {
4
3
  quoteId?: string | undefined;
5
4
  apiHost: string;
6
5
  token?: string | undefined;
@@ -1,9 +1,30 @@
1
- import { PluginData } from '@bunnyapp/common';
2
- export declare const usePaymentPlugins: ({ apiHost, token }: {
1
+ type PaymentPlugin = {
2
+ enabled: boolean;
3
+ entities: string[];
4
+ guid: string;
5
+ hidden: boolean;
6
+ id: string;
7
+ name: string;
8
+ status: string;
9
+ type: string;
10
+ webhookEnabled: boolean;
11
+ components: {
12
+ frontend: {
13
+ name: string;
14
+ scenarios: string[];
15
+ }[];
16
+ backend: {
17
+ name: string;
18
+ access: string[];
19
+ }[];
20
+ };
21
+ };
22
+ export declare const usePaymentPlugins: ({ apiHost, token, selectedEntityId, }: {
3
23
  apiHost: string;
4
24
  token?: string | undefined;
25
+ selectedEntityId?: string | null | undefined;
5
26
  }) => {
6
- paymentPlugins: PluginData[] | undefined;
27
+ paymentPlugins: PaymentPlugin[];
7
28
  isFetched: boolean;
8
29
  };
9
30
  export default usePaymentPlugins;
@@ -1,4 +1 @@
1
- export declare const BLUE_GRAY_HEX = "#717D94";
2
- export declare const CHARCOAL_GRAY = "#232323";
3
1
  export declare const PRIMARY_COLOR = "#FF5833";
4
- export declare const SECONDARY_SUCCESS_COLOR = "#00B76A";