@bunnyapp/components 1.0.57 → 1.0.58-beta.0.1

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 (106) hide show
  1. package/dist/cjs/index.js +2218 -2152
  2. package/dist/cjs/playground/main.d.ts +1 -1
  3. package/dist/cjs/src/components/BillingDetails/BillingDetails.d.ts +2 -2
  4. package/dist/cjs/src/components/BunnyProvider.d.ts +3 -3
  5. package/dist/cjs/src/components/Checkout/Checkout.d.ts +1 -2
  6. package/dist/cjs/src/components/PaymentForm/CheckoutFooter.d.ts +1 -1
  7. package/dist/cjs/src/components/PaymentForm/{PaymentMethod → DemoPay}/CreditCard/CreditCard.d.ts +11 -6
  8. package/dist/cjs/src/components/PaymentForm/DemoPay/CreditCard/index.d.ts +1 -0
  9. package/dist/cjs/src/components/PaymentForm/DemoPay/DemoPayForm.d.ts +1 -1
  10. package/dist/cjs/src/components/PaymentForm/DemoPay/hooks/useSave.d.ts +4 -3
  11. package/dist/cjs/src/components/PaymentForm/DemoPay/index.d.ts +1 -1
  12. package/dist/cjs/src/components/PaymentForm/PaymentForm.d.ts +3 -7
  13. package/dist/cjs/src/components/PaymentForm/PaymentMethodDetails.d.ts +4 -6
  14. package/dist/cjs/src/components/PaymentForm/Stripe/PaymentMethodForm.d.ts +1 -1
  15. package/dist/cjs/src/components/PaymentForm/Stripe/hooks/useSave.d.ts +4 -3
  16. package/dist/cjs/src/components/PaymentForm/hooks/useAutoSetDefaultPaymentMethod.d.ts +9 -0
  17. package/dist/cjs/src/components/PaymentForm/hooks/useHasActiveSubscription.d.ts +5 -0
  18. package/dist/cjs/src/components/PaymentForm/hooks/usePaymentMethodSelectorPlugin.d.ts +11 -0
  19. package/dist/cjs/src/components/PaymentForm/index.d.ts +1 -2
  20. package/dist/cjs/src/components/PaymentForm/useRemovePaymentMethod.d.ts +2 -2
  21. package/dist/cjs/src/components/PaymentForm/useSetDefaultPaymentMethod.d.ts +6 -0
  22. package/dist/cjs/src/components/Quote/Quote.d.ts +1 -1
  23. package/dist/cjs/src/components/Quote/StyledModal.d.ts +1 -1
  24. package/dist/cjs/src/components/Signup/PaymentForms.d.ts +1 -1
  25. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanManager.d.ts +1 -1
  26. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/NextPriceListButton.d.ts +2 -1
  27. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/CheckoutBarInput.d.ts +3 -2
  28. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/CheckoutBarSummarySection.d.ts +2 -3
  29. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/PlanPickerCheckoutBar.d.ts +1 -1
  30. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/EverythingPlanFeatures.d.ts +3 -2
  31. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/PlanFeatures.d.ts +3 -2
  32. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/PriceListGridDesktop.d.ts +1 -2
  33. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerUtils.d.ts +3 -2
  34. package/dist/cjs/src/components/Subscriptions/Subscriptions.d.ts +4 -3
  35. package/dist/cjs/src/components/Subscriptions/subscriptionsList/HideExpiredToggle.d.ts +1 -2
  36. package/dist/cjs/src/components/Subscriptions/subscriptionsList/SubscriptionsNavigation.d.ts +1 -1
  37. package/dist/cjs/src/components/icons/Cashapp.d.ts +4 -0
  38. package/dist/cjs/src/components/icons/Link.d.ts +4 -0
  39. package/dist/cjs/src/components/index.d.ts +11 -10
  40. package/dist/cjs/src/contexts/PaymentContext.d.ts +2 -1
  41. package/dist/cjs/src/graphql/QuoteRequests.d.ts +1 -0
  42. package/dist/cjs/src/graphql/mutations/quoteChargeCreate.d.ts +1 -2
  43. package/dist/cjs/src/graphql/mutations/quoteChargeUpdate.d.ts +12 -0
  44. package/dist/cjs/src/hooks/usePaymentMethod.d.ts +5 -4
  45. package/dist/cjs/src/hooks/usePaymentPlugins.d.ts +3 -3
  46. package/dist/esm/index.js +2223 -2157
  47. package/dist/esm/playground/main.d.ts +1 -1
  48. package/dist/esm/src/components/BillingDetails/BillingDetails.d.ts +2 -2
  49. package/dist/esm/src/components/BunnyProvider.d.ts +3 -3
  50. package/dist/esm/src/components/Checkout/Checkout.d.ts +1 -2
  51. package/dist/esm/src/components/PaymentForm/CheckoutFooter.d.ts +1 -1
  52. package/dist/esm/src/components/PaymentForm/{PaymentMethod → DemoPay}/CreditCard/CreditCard.d.ts +11 -6
  53. package/dist/esm/src/components/PaymentForm/DemoPay/CreditCard/index.d.ts +1 -0
  54. package/dist/esm/src/components/PaymentForm/DemoPay/DemoPayForm.d.ts +1 -1
  55. package/dist/esm/src/components/PaymentForm/DemoPay/hooks/useSave.d.ts +4 -3
  56. package/dist/esm/src/components/PaymentForm/DemoPay/index.d.ts +1 -1
  57. package/dist/esm/src/components/PaymentForm/PaymentForm.d.ts +3 -7
  58. package/dist/esm/src/components/PaymentForm/PaymentMethodDetails.d.ts +4 -6
  59. package/dist/esm/src/components/PaymentForm/Stripe/PaymentMethodForm.d.ts +1 -1
  60. package/dist/esm/src/components/PaymentForm/Stripe/hooks/useSave.d.ts +4 -3
  61. package/dist/esm/src/components/PaymentForm/hooks/useAutoSetDefaultPaymentMethod.d.ts +9 -0
  62. package/dist/esm/src/components/PaymentForm/hooks/useHasActiveSubscription.d.ts +5 -0
  63. package/dist/esm/src/components/PaymentForm/hooks/usePaymentMethodSelectorPlugin.d.ts +11 -0
  64. package/dist/esm/src/components/PaymentForm/index.d.ts +1 -2
  65. package/dist/esm/src/components/PaymentForm/useRemovePaymentMethod.d.ts +2 -2
  66. package/dist/esm/src/components/PaymentForm/useSetDefaultPaymentMethod.d.ts +6 -0
  67. package/dist/esm/src/components/Quote/Quote.d.ts +1 -1
  68. package/dist/esm/src/components/Quote/StyledModal.d.ts +1 -1
  69. package/dist/esm/src/components/Signup/PaymentForms.d.ts +1 -1
  70. package/dist/esm/src/components/Subscriptions/PlanManager/PlanManager.d.ts +1 -1
  71. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/NextPriceListButton.d.ts +2 -1
  72. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/CheckoutBarInput.d.ts +3 -2
  73. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/CheckoutBarSummarySection.d.ts +2 -3
  74. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/PlanPickerCheckoutBar.d.ts +1 -1
  75. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/EverythingPlanFeatures.d.ts +3 -2
  76. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/PlanFeatures.d.ts +3 -2
  77. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/PriceListGridDesktop.d.ts +1 -2
  78. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerUtils.d.ts +3 -2
  79. package/dist/esm/src/components/Subscriptions/Subscriptions.d.ts +4 -3
  80. package/dist/esm/src/components/Subscriptions/subscriptionsList/HideExpiredToggle.d.ts +1 -2
  81. package/dist/esm/src/components/Subscriptions/subscriptionsList/SubscriptionsNavigation.d.ts +1 -1
  82. package/dist/esm/src/components/icons/Cashapp.d.ts +4 -0
  83. package/dist/esm/src/components/icons/Link.d.ts +4 -0
  84. package/dist/esm/src/components/index.d.ts +11 -10
  85. package/dist/esm/src/contexts/PaymentContext.d.ts +2 -1
  86. package/dist/esm/src/graphql/QuoteRequests.d.ts +1 -0
  87. package/dist/esm/src/graphql/mutations/quoteChargeCreate.d.ts +1 -2
  88. package/dist/esm/src/graphql/mutations/quoteChargeUpdate.d.ts +12 -0
  89. package/dist/esm/src/hooks/usePaymentMethod.d.ts +5 -4
  90. package/dist/esm/src/hooks/usePaymentPlugins.d.ts +3 -3
  91. package/dist/index.d.ts +20 -18
  92. package/package.json +3 -2
  93. package/dist/cjs/src/components/PaymentForm/PaymentMethod/PaymentMethod.d.ts +0 -8
  94. package/dist/cjs/src/components/PaymentForm/PaymentMethod/PaymentMethod.stories.d.ts +0 -11
  95. package/dist/cjs/src/components/PaymentForm/PaymentMethod/index.d.ts +0 -1
  96. package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/consts.d.ts +0 -1
  97. package/dist/cjs/src/graphql/queries/getPortalPreviewQuery.d.ts +0 -2
  98. package/dist/esm/src/components/PaymentForm/PaymentMethod/PaymentMethod.d.ts +0 -8
  99. package/dist/esm/src/components/PaymentForm/PaymentMethod/PaymentMethod.stories.d.ts +0 -11
  100. package/dist/esm/src/components/PaymentForm/PaymentMethod/index.d.ts +0 -1
  101. package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerDesktop/consts.d.ts +0 -1
  102. package/dist/esm/src/graphql/queries/getPortalPreviewQuery.d.ts +0 -2
  103. /package/dist/cjs/src/components/PaymentForm/{PaymentMethod → DemoPay}/CreditCard/LargCardIcon.d.ts +0 -0
  104. /package/dist/cjs/src/components/PaymentForm/{PaymentMethod → DemoPay}/CreditCard/PlusIcon.d.ts +0 -0
  105. /package/dist/esm/src/components/PaymentForm/{PaymentMethod → DemoPay}/CreditCard/LargCardIcon.d.ts +0 -0
  106. /package/dist/esm/src/components/PaymentForm/{PaymentMethod → DemoPay}/CreditCard/PlusIcon.d.ts +0 -0
@@ -1 +1 @@
1
- import "../src/styles/output.less";
1
+ import '../src/styles/output.less';
@@ -1,5 +1,5 @@
1
- import "../../styles/index.less";
2
- import { ShadowType } from "../../types/shadowType";
1
+ import '../../styles/index.less';
2
+ import { ShadowType } from '../../types/shadowType';
3
3
  declare const BillingDetails: ({ isCardEnabled, shadow, className, hidePaymentMethodForm, hideBillingDetailsForm, countryListFilter, }: {
4
4
  isCardEnabled?: boolean | undefined;
5
5
  shadow?: ShadowType | undefined;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { QueryClient } from "@tanstack/react-query";
3
- import { ThemeConfig } from "antd";
4
- import { GraphQLClient } from "graphql-request";
2
+ import { QueryClient } from '@tanstack/react-query';
3
+ import { ThemeConfig } from 'antd';
4
+ import { GraphQLClient } from 'graphql-request';
5
5
  export type BunnyContextValues = {
6
6
  apiHost: string;
7
7
  graphQLClient: GraphQLClient;
@@ -4,7 +4,6 @@ interface CheckoutComponentProps extends CheckoutProps {
4
4
  isMobile: boolean;
5
5
  token?: string;
6
6
  storedPaymentMethod?: PaymentMethod;
7
- quantity?: number;
8
7
  }
9
- declare const Checkout: ({ onCancel, onSuccess, onFail, invoice, open, quote, selectedPriceList, token, quantity, }: CheckoutComponentProps) => import("react/jsx-runtime").JSX.Element | null;
8
+ declare const Checkout: ({ onCancel, onSuccess, onFail, invoice, open, quote, selectedPriceList, token, }: CheckoutComponentProps) => import("react/jsx-runtime").JSX.Element | null;
10
9
  export default Checkout;
@@ -1,4 +1,4 @@
1
- import { FormattedInvoice, PluginData, Quote } from "@bunnyapp/common";
1
+ import { FormattedInvoice, PluginData, Quote } from '@bunnyapp/common';
2
2
  declare const CheckoutFooter: ({ quote, invoice, onPaymentSuccess, noPadding, plugin, }: {
3
3
  quote?: Quote | undefined;
4
4
  invoice?: FormattedInvoice | undefined;
@@ -1,5 +1,5 @@
1
- import { PaymentMethod } from "@bunnyapp/common";
2
- import { ShadowType } from "../../../../types/shadowType";
1
+ import { PaymentMethod } from '@bunnyapp/common';
2
+ import { ShadowType } from '../../../../types/shadowType';
3
3
  type CreditCardProps = {
4
4
  onClickRemove: () => void;
5
5
  onClickUpdate: () => void;
@@ -8,10 +8,15 @@ type CreditCardProps = {
8
8
  cardEnabled?: boolean;
9
9
  };
10
10
  declare const CreditCard: ({ onClickRemove, onClickUpdate, paymentMethodData, shadow, cardEnabled, }: CreditCardProps) => import("react/jsx-runtime").JSX.Element;
11
- export declare const MiniCreditCard: ({ hideRemoveButton, onClickRemove, paymentMethodData, }: {
12
- hideRemoveButton?: boolean | undefined;
13
- onClickRemove: () => void;
14
- paymentMethodData: PaymentMethod;
11
+ export declare const MiniCreditCard: ({ className, buttons, hideDropdownMenu, hideDefaultTag, onClickRemove, paymentMethodData, onClickSetDefault, id, }: {
12
+ className?: string | undefined;
13
+ buttons?: React.ReactNode;
14
+ hideDropdownMenu?: boolean | undefined;
15
+ hideDefaultTag?: boolean | undefined;
16
+ onClickRemove?: (() => void) | undefined;
17
+ paymentMethodData?: PaymentMethod | undefined;
18
+ onClickSetDefault?: (() => void) | undefined;
19
+ id?: string | undefined;
15
20
  }) => import("react/jsx-runtime").JSX.Element;
16
21
  declare const EmptyCard: ({ onClick, shadow, cardEnabled, }: {
17
22
  onClick: () => void;
@@ -0,0 +1 @@
1
+ export { MiniCreditCard } from './CreditCard';
@@ -1,4 +1,4 @@
1
- import { PluginData } from "@bunnyapp/common";
1
+ import { PluginData } from '@bunnyapp/common';
2
2
  declare const DemoPayForm: ({ onFail, onSavePaymentMethod, plugin, }: {
3
3
  onFail: (error: any) => void;
4
4
  onSavePaymentMethod: (response: any) => void;
@@ -1,6 +1,7 @@
1
- import { FormattedInvoice, PluginData, Quote } from "@bunnyapp/common";
2
- export declare function useSave({ onSaveSuccess, token, apiHost, accountId, }: {
3
- onSaveSuccess: (response: any) => void;
1
+ import { FormattedInvoice, PluginData, Quote } from '@bunnyapp/common';
2
+ export declare function useSave({ onSaveSuccess, onSaveError, token, apiHost, accountId, }: {
3
+ onSaveSuccess?: (response: any) => void;
4
+ onSaveError?: (error: any) => void;
4
5
  quote?: Quote;
5
6
  invoice?: FormattedInvoice;
6
7
  token?: string;
@@ -1 +1 @@
1
- export { default as DemoPayForm } from "./DemoPayForm";
1
+ export { MiniCreditCard } from './CreditCard';
@@ -1,18 +1,14 @@
1
- /// <reference types="react" />
2
- import { FormattedInvoice, PluginData, Quote } from "@bunnyapp/common";
3
- import { GraphQLClient } from "graphql-request";
4
- export declare const PaymentForm: ({ invoice, onFail, onPaymentSuccess, quote, accountId, onSavePaymentMethod, onRemovePaymentMethod, overrideToken, graphQLClient, customCheckoutFunction, currencyId: currencyIdFromProps, customPaymentForms, useAllPaymentPlugins, }: {
1
+ import { FormattedInvoice, PluginData, Quote } from '@bunnyapp/common';
2
+ export declare const PaymentForm: ({ invoice, onFail, onPaymentSuccess, quote, accountId, onSavePaymentMethod, onRemovePaymentMethod, onSetDefaultPaymentMethod, overrideToken, customCheckoutFunction, currencyId: currencyIdFromProps, }: {
5
3
  invoice?: FormattedInvoice | undefined;
6
4
  quote?: Quote | undefined;
7
5
  onFail: (error: any) => void;
8
6
  onPaymentSuccess?: (() => void) | undefined;
9
7
  onSavePaymentMethod?: (() => void) | undefined;
10
8
  onRemovePaymentMethod?: (() => void) | undefined;
9
+ onSetDefaultPaymentMethod?: (() => void) | undefined;
11
10
  accountId?: string | undefined;
12
11
  overrideToken?: string | undefined;
13
- graphQLClient: GraphQLClient;
14
12
  customCheckoutFunction?: ((plugin: PluginData | undefined) => Promise<any>) | undefined;
15
13
  currencyId?: string | undefined;
16
- customPaymentForms?: Record<string, import("react").ReactNode> | undefined;
17
- useAllPaymentPlugins?: boolean | undefined;
18
14
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,7 @@
1
- /// <reference types="react" />
2
- import { PaymentMethod, PluginData } from "@bunnyapp/common";
3
- declare const PaymentMethodDetails: ({ onFail, paymentMethod, onSavePaymentMethod, customPaymentForms, }: {
1
+ import { PluginData } from '@bunnyapp/common';
2
+ declare const PaymentMethodDetails: ({ onFail, plugin, onSavePaymentMethod, }: {
4
3
  onFail: (error: any) => void;
5
- paymentMethod: PaymentMethod | PluginData;
4
+ plugin: PluginData;
6
5
  onSavePaymentMethod: () => void;
7
- customPaymentForms?: Record<string, import("react").ReactNode> | undefined;
8
- }) => import("react/jsx-runtime").JSX.Element | null;
6
+ }) => import("react/jsx-runtime").JSX.Element;
9
7
  export default PaymentMethodDetails;
@@ -1,4 +1,4 @@
1
- import { PluginData } from "@bunnyapp/common";
1
+ import { PluginData } from '@bunnyapp/common';
2
2
  declare const PaymentMethodForm: ({ plugin, onFail, onSavePaymentMethod, }: {
3
3
  plugin: PluginData;
4
4
  onFail: (error: any) => void;
@@ -1,6 +1,7 @@
1
- import { PluginData } from "@bunnyapp/common";
2
- export declare function useSave({ onSaveSuccess, }: {
3
- onSaveSuccess: (response: any) => void;
1
+ import { PluginData } from '@bunnyapp/common';
2
+ export declare function useSave({ onSaveSuccess, onSaveError, }: {
3
+ onSaveSuccess?: (response: any) => void;
4
+ onSaveError?: (error: any) => void;
4
5
  }): {
5
6
  save: ({ plugin }: {
6
7
  plugin: PluginData;
@@ -0,0 +1,9 @@
1
+ import { PaymentMethod } from '@bunnyapp/common';
2
+ declare const useAutoSetDefaultPaymentMethod: ({ accountId, token, handleSetDefault, setDefaultPaymentMethodLoading, enabled, }: {
3
+ accountId: string | undefined;
4
+ token?: string | undefined;
5
+ handleSetDefault: (paymentMethod: PaymentMethod) => void;
6
+ setDefaultPaymentMethodLoading: boolean;
7
+ enabled?: boolean | undefined;
8
+ }) => void;
9
+ export default useAutoSetDefaultPaymentMethod;
@@ -0,0 +1,5 @@
1
+ declare function useHasActiveSubscription({ token, apiHost, }: {
2
+ token: string;
3
+ apiHost: string;
4
+ }): any;
5
+ export default useHasActiveSubscription;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { PaymentMethod, PluginData } from "@bunnyapp/common";
3
+ declare const usePaymentMethodSelectorPlugin: ({ defaultPaymentMethod, defaultPaymentMethodPlugin, paymentMethodAllowedPlugins, }: {
4
+ defaultPaymentMethod: PaymentMethod | undefined;
5
+ defaultPaymentMethodPlugin: PluginData | undefined;
6
+ paymentMethodAllowedPlugins: PluginData[] | undefined;
7
+ }) => {
8
+ selectorPaymentMethodPlugin: PluginData | undefined;
9
+ setSelectorPaymentMethodPlugin: import("react").Dispatch<import("react").SetStateAction<PluginData | undefined>>;
10
+ };
11
+ export default usePaymentMethodSelectorPlugin;
@@ -1,2 +1 @@
1
- export { PaymentMethod } from "./PaymentMethod";
2
- export { PaymentForm } from "./PaymentForm";
1
+ export { PaymentForm } from './PaymentForm';
@@ -1,3 +1,3 @@
1
- import { PluginData } from "@bunnyapp/common";
2
- declare function useRemovePaymentMethod(paymentPlugins: PluginData[], apiHost: string, token?: string, accountId?: string, onRemovePaymentMethod?: () => void): (data: any) => Promise<void>;
1
+ import { PluginData } from '@bunnyapp/common';
2
+ declare function useRemovePaymentMethod(paymentPlugins: PluginData[], apiHost: string, token?: string, accountId?: string, onRemovePaymentMethod?: () => void, onError?: (message: string) => void): (data: any) => Promise<void>;
3
3
  export default useRemovePaymentMethod;
@@ -0,0 +1,6 @@
1
+ import { PluginData } from '@bunnyapp/common';
2
+ declare function useSetDefaultPaymentMethod(paymentPlugins: PluginData[], apiHost: string, token?: string, accountId?: string, onError?: (message: string) => void, onSuccess?: () => void): {
3
+ setDefaultPaymentMethod: (data: any) => Promise<void>;
4
+ loading: boolean;
5
+ };
6
+ export default useSetDefaultPaymentMethod;
@@ -1,3 +1,3 @@
1
- import { InvoiceQuoteContextProps } from "../Invoice/InvoiceQuoteContext";
1
+ import { InvoiceQuoteContextProps } from '../Invoice/InvoiceQuoteContext';
2
2
  export declare const MarkupContainer: any;
3
3
  export default function Quote({ id, invoiceQuoteViewComponent, onInvoiceDownloadError, onPaymentSuccess, shadow, className, hideDownloadButton, onQuoteLoaded, }: InvoiceQuoteContextProps): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,3 @@
1
- import { ModalProps } from "antd";
1
+ import { ModalProps } from 'antd';
2
2
  declare const StyledModal: (props: ModalProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default StyledModal;
@@ -1,4 +1,4 @@
1
- import { PluginData, Quote } from "@bunnyapp/common";
1
+ import { PluginData, Quote } from '@bunnyapp/common';
2
2
  export default function PaymentForms({ quote, handlePaymentSuccess, handlePaymentFail, handleSubmit, proceedingToPayment, accountId, overrideToken, customCheckoutFunction, }: {
3
3
  quote?: Quote;
4
4
  handlePaymentSuccess: () => void;
@@ -1,5 +1,5 @@
1
1
  declare const PlanManager: ({ onChangePlanCancel, handlePortalErrors, }: {
2
2
  onChangePlanCancel: () => void;
3
- handlePortalErrors: (error: any) => void;
3
+ handlePortalErrors?: ((error: any) => void) | undefined;
4
4
  }) => import("react/jsx-runtime").JSX.Element;
5
5
  export default PlanManager;
@@ -1,7 +1,8 @@
1
1
  import { Dispatch, SetStateAction } from "react";
2
2
  import { PriceList } from "@bunnyapp/common";
3
- declare const NextPriceListButton: ({ availablePriceLists, priceListStart, setPriceListStart, }: {
3
+ declare const NextPriceListButton: ({ availablePriceLists, priceListStart, setPriceListStart, numberOfPlansToDisplay, }: {
4
4
  availablePriceLists: PriceList[];
5
+ numberOfPlansToDisplay: number;
5
6
  priceListStart: number;
6
7
  setPriceListStart: Dispatch<SetStateAction<number>>;
7
8
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,9 @@
1
1
  import { PriceList, PriceListCharge } from "@bunnyapp/common";
2
- declare const CheckoutBarInput: ({ charge, quantity, selectedPriceList, setQuantity, }: {
2
+ declare const CheckoutBarInput: ({ disabled, charge, quantity, selectedPriceList, onQuantityChanged, }: {
3
+ disabled?: boolean | undefined;
3
4
  charge: PriceListCharge;
4
5
  quantity: number;
5
6
  selectedPriceList?: PriceList | undefined;
6
- setQuantity: (quantity: number) => void;
7
+ onQuantityChanged: (quantity: number) => void;
7
8
  }) => import("react/jsx-runtime").JSX.Element | null;
8
9
  export default CheckoutBarInput;
@@ -1,7 +1,6 @@
1
- import { PriceList, Quote, QuotePreviewData, Subscription } from "@bunnyapp/common";
2
- declare const CheckoutBarSummarySection: ({ open, quantityLocal, quote, selectedPriceList, onClickCheckout, upgradingSubscription, quotePreviewData, }: {
1
+ import { PriceList, Quote, QuotePreviewData, Subscription } from '@bunnyapp/common';
2
+ declare const CheckoutBarSummarySection: ({ open, quote, selectedPriceList, onClickCheckout, upgradingSubscription, quotePreviewData, }: {
3
3
  open: boolean;
4
- quantityLocal: number;
5
4
  quote?: Quote | undefined;
6
5
  selectedPriceList: PriceList;
7
6
  onClickCheckout: () => void;
@@ -1,5 +1,5 @@
1
1
  declare const PlanPickerCheckoutBarWrapper: ({ handlePortalErrors, onCheckoutSuccess, }: {
2
- handlePortalErrors: (errors: any) => void;
2
+ handlePortalErrors?: ((errors: any) => void) | undefined;
3
3
  onCheckoutSuccess: () => void;
4
4
  }) => import("react/jsx-runtime").JSX.Element | null;
5
5
  export default PlanPickerCheckoutBarWrapper;
@@ -1,6 +1,7 @@
1
- import { PriceList, Product } from "@bunnyapp/common";
2
- declare const EverythingPlanFeatures: ({ availablePriceLists, selectedProduct, }: {
1
+ import { PriceList, Product } from '@bunnyapp/common';
2
+ declare const EverythingPlanFeatures: ({ availablePriceLists, selectedProduct, plansToDisplay, }: {
3
3
  availablePriceLists: PriceList[];
4
+ plansToDisplay: number;
4
5
  selectedProduct?: Product | undefined;
5
6
  }) => import("react/jsx-runtime").JSX.Element;
6
7
  export default EverythingPlanFeatures;
@@ -1,6 +1,7 @@
1
- import { Plan, Product } from "@bunnyapp/common";
2
- declare const PlanFeatures: ({ availablePlansArray, selectedProduct, }: {
1
+ import { Plan, Product } from '@bunnyapp/common';
2
+ declare const PlanFeatures: ({ availablePlansArray, selectedProduct, plansToDisplay, }: {
3
3
  availablePlansArray: Plan[];
4
+ plansToDisplay: number;
4
5
  selectedProduct?: Product | undefined;
5
6
  }) => import("react/jsx-runtime").JSX.Element;
6
7
  export default PlanFeatures;
@@ -1,6 +1,5 @@
1
- import { Product, PriceList, Subscription, PriceListChangeOptions } from "@bunnyapp/common";
1
+ import { PriceList, PriceListChangeOptions, Product, Subscription } from "@bunnyapp/common";
2
2
  import { Dispatch, SetStateAction } from "react";
3
- export declare const PLANS_TO_DISPLAY = 3;
4
3
  type PriceListGridDesktopProps = {
5
4
  availablePriceLists: PriceList[];
6
5
  onChangePriceList: (selectedPriceList: PriceList) => void;
@@ -1,12 +1,13 @@
1
1
  import { PriceList, PriceListChangeOptions } from "@bunnyapp/common";
2
- export declare const getAvailablePlansAndPriceLists: ({ availablePriceLists, priceListChangeOptions, priceListStart, }: {
2
+ export declare const getAvailablePlansAndPriceLists: ({ availablePriceLists, priceListChangeOptions, priceListStart, plansToDisplay, }: {
3
3
  availablePriceLists: PriceList[];
4
4
  priceListChangeOptions?: PriceListChangeOptions | undefined;
5
5
  priceListStart: number;
6
+ plansToDisplay: number;
6
7
  }) => {
7
8
  availablePlansArray: import("@bunnyapp/common").Plan[];
8
9
  displayPriceLists: PriceList[];
9
10
  };
10
- export declare const everythingInPlusString: ({ priceList }: {
11
+ export declare const everythingInPlusString: ({ priceList, }: {
11
12
  priceList: PriceList;
12
13
  }) => string;
@@ -1,10 +1,10 @@
1
- import { ReactNode } from "react";
1
+ import { ReactNode } from 'react';
2
2
  export type EditingQuoteDataType = {
3
3
  id: string;
4
4
  isTrial: boolean;
5
5
  };
6
- declare const SubscriptionsWrapper: ({ handlePortalErrors, companyName, isInPreviewMode, productId, className, styles: userStyles, noSubscriptionsComponent, hideTitle, }: {
7
- handlePortalErrors: (errors: any) => void;
6
+ declare const SubscriptionsWrapper: ({ handlePortalErrors, companyName, isInPreviewMode, productId, className, styles: userStyles, noSubscriptionsComponent, hideTitle, hideExpiredToggle, }: {
7
+ handlePortalErrors?: ((errors: any) => void) | undefined;
8
8
  companyName: string;
9
9
  isInPreviewMode?: boolean | undefined;
10
10
  productId?: string | undefined;
@@ -16,5 +16,6 @@ declare const SubscriptionsWrapper: ({ handlePortalErrors, companyName, isInPrev
16
16
  } | undefined;
17
17
  noSubscriptionsComponent?: React.ReactNode;
18
18
  hideTitle?: boolean | undefined;
19
+ hideExpiredToggle?: boolean | undefined;
19
20
  }) => import("react/jsx-runtime").JSX.Element;
20
21
  export default SubscriptionsWrapper;
@@ -1,6 +1,5 @@
1
- declare const HideExpiredToggle: ({ hideExpired, setHideExpired, visible, }: {
1
+ declare const HideExpiredToggle: ({ hideExpired, setHideExpired, }: {
2
2
  hideExpired: boolean;
3
3
  setHideExpired: (value: boolean) => void;
4
- visible: boolean;
5
4
  }) => import("react/jsx-runtime").JSX.Element;
6
5
  export default HideExpiredToggle;
@@ -1,4 +1,4 @@
1
- import { Subscription } from "@bunnyapp/common";
1
+ import { Subscription } from '@bunnyapp/common';
2
2
  declare const SubscriptionsNavigation: ({ expiredSwitchVisible, hideExpired, setHideExpired, setQuantityDrawerOpen, subscriptions, }: {
3
3
  expiredSwitchVisible: boolean;
4
4
  hideExpired: boolean;
@@ -0,0 +1,4 @@
1
+ declare const Cashapp: ({ className }: {
2
+ className?: string | undefined;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
+ export default Cashapp;
@@ -0,0 +1,4 @@
1
+ declare const Cashapp: ({ className }: {
2
+ className?: string | undefined;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
+ export default Cashapp;
@@ -1,10 +1,11 @@
1
- export { Invoice } from "./Invoice";
2
- export { Quote } from "./Quote";
3
- export { Quotes } from "./Quotes";
4
- export { PaymentMethod, PaymentForm } from "./PaymentForm";
5
- export { Signup } from "./Signup";
6
- export { default as BunnyProvider } from "./BunnyProvider";
7
- export { default as Transactions } from "./Transactions";
8
- export { Subscriptions } from "./Subscriptions";
9
- export { BillingDetails } from "./BillingDetails";
10
- export { Footer } from "./Footer";
1
+ export { Invoice } from './Invoice';
2
+ export { Quote } from './Quote';
3
+ export { Quotes } from './Quotes';
4
+ export { PaymentForm } from './PaymentForm';
5
+ export { Signup } from './Signup';
6
+ export { default as BunnyProvider } from './BunnyProvider';
7
+ export { default as Transactions } from './Transactions';
8
+ export { Subscriptions } from './Subscriptions';
9
+ export { BillingDetails } from './BillingDetails';
10
+ export { Footer } from './Footer';
11
+ export { MiniCreditCard } from './PaymentForm/DemoPay/CreditCard';
@@ -4,7 +4,8 @@ export type PaymentContextValues = {
4
4
  onClickCancel?: () => void;
5
5
  accountId?: string;
6
6
  overrideToken?: string;
7
- storedPaymentMethod?: PaymentMethod;
7
+ storedPaymentMethods?: PaymentMethod[];
8
+ defaultPaymentMethod?: PaymentMethod;
8
9
  customCheckoutFunction?: (plugin: PluginData | undefined) => Promise<any>;
9
10
  };
10
11
  export declare const PaymentContext: import("react").Context<PaymentContextValues>;
@@ -1,3 +1,4 @@
1
+ export declare const useQuoteSubscriptionUpgrade: () => (subscriptionId: string, priceListId: string, apiHost: string, token?: string) => Promise<unknown>;
1
2
  export declare const useCreateSubscriptionQuote: () => (subscriptionIds: string[], apiHost: string, token?: string) => Promise<unknown>;
2
3
  export declare const useQuoteChangeUpdate: () => (charges: {
3
4
  id: string;
@@ -1,6 +1,5 @@
1
1
  type QuoteChangeCreateChargeProps = {
2
2
  apiHost: string;
3
- endDate: string;
4
3
  price?: number;
5
4
  priceListChargeId?: string;
6
5
  quantity?: number;
@@ -9,5 +8,5 @@ type QuoteChangeCreateChargeProps = {
9
8
  subscriptionChargeId?: string;
10
9
  token?: string;
11
10
  };
12
- declare const quoteChargeCreate: ({ endDate, price, priceListChargeId, quantity, quoteChangeId, startDate, subscriptionChargeId, token, apiHost, }: QuoteChangeCreateChargeProps) => Promise<unknown>;
11
+ declare const quoteChargeCreate: ({ price, priceListChargeId, quantity, quoteChangeId, startDate, subscriptionChargeId, token, apiHost, }: QuoteChangeCreateChargeProps) => Promise<unknown>;
13
12
  export default quoteChargeCreate;
@@ -0,0 +1,12 @@
1
+ declare const quoteChargeUpdate: ({ discount, name, price, quantity, quoteChargeId, startDate, subtotal, apiHost, token, }: {
2
+ discount?: number | undefined;
3
+ name?: string | undefined;
4
+ price?: number | undefined;
5
+ quantity?: number | undefined;
6
+ quoteChargeId: string;
7
+ startDate?: string | undefined;
8
+ subtotal?: number | undefined;
9
+ apiHost: string;
10
+ token: string;
11
+ }) => Promise<unknown>;
12
+ export default quoteChargeUpdate;
@@ -1,9 +1,10 @@
1
- import { GraphQLClient } from "graphql-request";
2
- export declare const usePaymentMethod: ({ accountId, graphQLClient, token, }: {
1
+ import { PaymentMethod } from '@bunnyapp/common';
2
+ export declare const usePaymentMethod: ({ accountId, token, apiHost, }: {
3
3
  accountId?: string | undefined;
4
- graphQLClient: GraphQLClient;
5
4
  token?: string | undefined;
5
+ apiHost: string;
6
6
  }) => {
7
- data: any;
7
+ paymentMethods: PaymentMethod[];
8
+ defaultPaymentMethod: PaymentMethod | undefined;
8
9
  isLoading: boolean;
9
10
  };
@@ -1,10 +1,10 @@
1
- import { PluginData } from "@bunnyapp/common";
2
- export declare const usePaymentPlugins: ({ apiHost, token, }: {
1
+ import { PluginData } from '@bunnyapp/common';
2
+ export declare const usePaymentPlugins: ({ apiHost, token, accountId, }: {
3
3
  apiHost: string;
4
4
  token?: string | undefined;
5
+ accountId?: string | undefined;
5
6
  }) => {
6
7
  paymentPlugins: PluginData[] | undefined;
7
- paymentMethodAllowedPlugins: PluginData[] | undefined;
8
8
  isFetched: boolean;
9
9
  };
10
10
  export default usePaymentPlugins;
package/dist/index.d.ts CHANGED
@@ -1,11 +1,10 @@
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, PluginData, TransactionKind } from '@bunnyapp/common';
4
- import * as react from 'react';
5
- import react__default from 'react';
6
- import { GraphQLClient } from 'graphql-request';
3
+ import { FormattedInvoice, FormattedQuote, FrontendTransaction, Quote as Quote$1, PluginData, TransactionKind, PaymentMethod } from '@bunnyapp/common';
7
4
  import { QueryClient } from '@tanstack/react-query';
8
5
  import { ThemeConfig } from 'antd';
6
+ import * as react from 'react';
7
+ import react__default from 'react';
9
8
 
10
9
  type ShadowType = "shadow-none" | "shadow-sm" | "shadow-md" | "shadow-lg" | "shadow-xl";
11
10
 
@@ -72,27 +71,18 @@ declare function Quotes({ className, columns, filter, filterQuotes, sort, noQuot
72
71
  noQuotesMessage?: string;
73
72
  }): react_jsx_runtime.JSX.Element;
74
73
 
75
- declare const PaymentMethod: ({ className, shadow, cardEnabled, useModal, }: {
76
- className?: string | undefined;
77
- shadow?: ShadowType | undefined;
78
- cardEnabled?: boolean | undefined;
79
- useModal?: boolean | undefined;
80
- }) => react_jsx_runtime.JSX.Element;
81
-
82
- declare const PaymentForm: ({ invoice, onFail, onPaymentSuccess, quote, accountId, onSavePaymentMethod, onRemovePaymentMethod, overrideToken, graphQLClient, customCheckoutFunction, currencyId: currencyIdFromProps, customPaymentForms, useAllPaymentPlugins, }: {
74
+ declare const PaymentForm: ({ invoice, onFail, onPaymentSuccess, quote, accountId, onSavePaymentMethod, onRemovePaymentMethod, onSetDefaultPaymentMethod, overrideToken, customCheckoutFunction, currencyId: currencyIdFromProps, }: {
83
75
  invoice?: FormattedInvoice | undefined;
84
76
  quote?: Quote$1 | undefined;
85
77
  onFail: (error: any) => void;
86
78
  onPaymentSuccess?: (() => void) | undefined;
87
79
  onSavePaymentMethod?: (() => void) | undefined;
88
80
  onRemovePaymentMethod?: (() => void) | undefined;
81
+ onSetDefaultPaymentMethod?: (() => void) | undefined;
89
82
  accountId?: string | undefined;
90
83
  overrideToken?: string | undefined;
91
- graphQLClient: GraphQLClient;
92
84
  customCheckoutFunction?: ((plugin: PluginData | undefined) => Promise<any>) | undefined;
93
85
  currencyId?: string | undefined;
94
- customPaymentForms?: Record<string, react.ReactNode> | undefined;
95
- useAllPaymentPlugins?: boolean | undefined;
96
86
  }) => react_jsx_runtime.JSX.Element;
97
87
 
98
88
  declare function Signup({ companyName, priceListCode, returnUrl, isCardEnabled, className, shadow, style, entityId, }: {
@@ -170,8 +160,8 @@ declare function Transactions({ transactionComponent, showSearchBar, showTitle,
170
160
  transactionDateType?: TransactionDateType;
171
161
  }): react_jsx_runtime.JSX.Element;
172
162
 
173
- declare const SubscriptionsWrapper: ({ handlePortalErrors, companyName, isInPreviewMode, productId, className, styles: userStyles, noSubscriptionsComponent, hideTitle, }: {
174
- handlePortalErrors: (errors: any) => void;
163
+ declare const SubscriptionsWrapper: ({ handlePortalErrors, companyName, isInPreviewMode, productId, className, styles: userStyles, noSubscriptionsComponent, hideTitle, hideExpiredToggle, }: {
164
+ handlePortalErrors?: ((errors: any) => void) | undefined;
175
165
  companyName: string;
176
166
  isInPreviewMode?: boolean | undefined;
177
167
  productId?: string | undefined;
@@ -183,6 +173,7 @@ declare const SubscriptionsWrapper: ({ handlePortalErrors, companyName, isInPrev
183
173
  } | undefined;
184
174
  noSubscriptionsComponent?: React.ReactNode;
185
175
  hideTitle?: boolean | undefined;
176
+ hideExpiredToggle?: boolean | undefined;
186
177
  }) => react_jsx_runtime.JSX.Element;
187
178
 
188
179
  declare const BillingDetails: ({ isCardEnabled, shadow, className, hidePaymentMethodForm, hideBillingDetailsForm, countryListFilter, }: {
@@ -201,4 +192,15 @@ declare const Footer: ({ className }: {
201
192
  className?: string | undefined;
202
193
  }) => react_jsx_runtime.JSX.Element;
203
194
 
204
- export { BillingDetails, BunnyProvider, Footer, Invoice, PaymentForm, PaymentMethod, Quote, Quotes, Signup, SubscriptionsWrapper as Subscriptions, Transactions };
195
+ declare const MiniCreditCard: ({ className, buttons, hideDropdownMenu, hideDefaultTag, onClickRemove, paymentMethodData, onClickSetDefault, id, }: {
196
+ className?: string | undefined;
197
+ buttons?: React.ReactNode;
198
+ hideDropdownMenu?: boolean | undefined;
199
+ hideDefaultTag?: boolean | undefined;
200
+ onClickRemove?: (() => void) | undefined;
201
+ paymentMethodData?: PaymentMethod | undefined;
202
+ onClickSetDefault?: (() => void) | undefined;
203
+ id?: string | undefined;
204
+ }) => react_jsx_runtime.JSX.Element;
205
+
206
+ export { BillingDetails, BunnyProvider, Footer, Invoice, MiniCreditCard, PaymentForm, Quote, Quotes, Signup, SubscriptionsWrapper as Subscriptions, Transactions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bunnyapp/components",
3
- "version": "1.0.57",
3
+ "version": "1.0.58-beta.0.1",
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",
@@ -47,6 +47,7 @@
47
47
  "autoprefixer": "^10.4.20",
48
48
  "dependency-cruiser": "^16.8.0",
49
49
  "eslint-plugin-storybook": "^0.11.1",
50
+ "glob": "^11.0.2",
50
51
  "less": "^4.2.0",
51
52
  "msw": "^2.6.5",
52
53
  "postcss-less": "^6.0.0",
@@ -64,7 +65,7 @@
64
65
  },
65
66
  "peerDependencies": {
66
67
  "@ant-design/icons": "^5.6.1",
67
- "@bunnyapp/common": "^1.0.55",
68
+ "@bunnyapp/common": "^1.0.58",
68
69
  "@fortawesome/fontawesome-svg-core": "^6.7.2",
69
70
  "@fortawesome/free-brands-svg-icons": "^6.7.2",
70
71
  "@fortawesome/free-regular-svg-icons": "^6.7.2",
@@ -1,8 +0,0 @@
1
- import "../../../styles/index.less";
2
- import { ShadowType } from "../../../types/shadowType";
3
- export declare const PaymentMethod: ({ className, shadow, cardEnabled, useModal, }: {
4
- className?: string | undefined;
5
- shadow?: ShadowType | undefined;
6
- cardEnabled?: boolean | undefined;
7
- useModal?: boolean | undefined;
8
- }) => import("react/jsx-runtime").JSX.Element;
@@ -1,11 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { PaymentMethod } from "./PaymentMethod";
3
- declare const meta: Meta<typeof PaymentMethod>;
4
- export default meta;
5
- type Story = StoryObj<typeof meta>;
6
- export declare const Default: Story;
7
- export declare const CustomClassName: Story;
8
- export declare const NoShadow: Story;
9
- export declare const NoCard: Story;
10
- export declare const Mobile: Story;
11
- export declare const DarkMode: Story;
@@ -1 +0,0 @@
1
- export { PaymentMethod } from "./PaymentMethod";