@bunnyapp/components 1.8.0-beta.7 → 1.8.0-beta.9

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 (100) hide show
  1. package/dist/cjs/index.js +5414 -5419
  2. package/dist/cjs/types/src/components/PaymentForm/DemoPay/DemoPayFormProvider.d.ts +10 -0
  3. package/dist/cjs/types/src/components/PaymentForm/DemoPay/hooks/usePay.d.ts +2 -4
  4. package/dist/cjs/types/src/components/PaymentForm/DemoPay/hooks/useSave.d.ts +1 -5
  5. package/dist/cjs/types/src/components/PaymentForm/PaymentForm.d.ts +40 -9
  6. package/dist/cjs/types/src/components/PaymentForm/Stripe/StripeFormProvider.d.ts +5 -0
  7. package/dist/cjs/types/src/components/PaymentForm/Stripe/hooks/usePay.d.ts +2 -4
  8. package/dist/cjs/types/src/components/PaymentForm/components/CheckoutNoPayment.d.ts +6 -0
  9. package/dist/cjs/types/src/components/PaymentForm/components/Pay.d.ts +5 -0
  10. package/dist/cjs/types/src/components/PaymentForm/components/PaymentMethodDetails/PaymentMethodDetails.d.ts +12 -0
  11. package/dist/cjs/types/src/components/PaymentForm/components/PaymentMethodDetails/components/Cancel.d.ts +1 -0
  12. package/dist/cjs/types/src/components/PaymentForm/components/PaymentMethodDetails/components/Save.d.ts +1 -0
  13. package/dist/cjs/types/src/components/PaymentForm/components/StoredPaymentMethods.d.ts +18 -0
  14. package/dist/cjs/types/src/components/PaymentForm/context/AccountIdContext.d.ts +5 -0
  15. package/dist/cjs/types/src/components/PaymentForm/context/CallbacksContext.d.ts +14 -0
  16. package/dist/cjs/types/src/components/PaymentForm/context/PaymentMethodFormVisibilityContext.d.ts +12 -0
  17. package/dist/cjs/types/src/components/PaymentForm/context/PaymentProvider.d.ts +46 -37
  18. package/dist/cjs/types/src/components/PaymentForm/hooks/usePay.d.ts +14 -0
  19. package/dist/cjs/types/src/components/PaymentForm/hooks/usePaymentButtonText.d.ts +7 -1
  20. package/dist/cjs/types/src/components/PaymentForm/hooks/usePaymentHold.d.ts +18 -0
  21. package/dist/cjs/types/src/components/PaymentForm/hooks/useSave.d.ts +16 -0
  22. package/dist/cjs/types/src/components/PaymentForm/types/PaymentType.d.ts +2 -1
  23. package/dist/cjs/types/src/components/QuoteProvider/context/quantityEditableChargesContext.d.ts +2 -8
  24. package/dist/cjs/types/src/components/QuoteProvider/fragments/quoteFragment.d.ts +5 -3
  25. package/dist/cjs/types/src/components/QuoteProvider/fragments/useQuantityEditableCharges_PriceListChargeFragment.d.ts +16 -0
  26. package/dist/cjs/types/src/components/QuoteProvider/fragments/useQuantityEditableCharges_QuoteFragment.d.ts +26 -0
  27. package/dist/cjs/types/src/components/QuoteProvider/fragments/useQuoteQuantities_PriceListChargeFragment.d.ts +13 -0
  28. package/dist/cjs/types/src/components/QuoteProvider/hooks/useQuantityEditableCharges.d.ts +41 -36
  29. package/dist/cjs/types/src/components/QuoteProvider/hooks/useQuoteCreate.d.ts +14 -3
  30. package/dist/cjs/types/src/components/QuoteProvider/hooks/useQuoteQuantities.d.ts +3 -19
  31. package/dist/cjs/types/src/components/QuoteProvider/hooks/useSelectedPriceListQuoteChange.d.ts +18 -30
  32. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/checkoutBar/CheckoutBarInput/CheckoutBarInput.d.ts +1 -13
  33. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/checkoutBar/CheckoutBarInput/fragments/CheckoutBarInput_PriceListChargeFragment.d.ts +13 -0
  34. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/checkoutBar/CheckoutBarInput/fragments/useChargeCRUD_QuoteFragment.d.ts +22 -0
  35. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/checkoutBar/CheckoutBarInput/hooks/useChargeCRUD.d.ts +1 -1
  36. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/checkoutBar/PlanPickerCheckoutBar.d.ts +0 -14
  37. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/checkoutBar/fragments/PlanPickerCheckoutBar_PriceListChargeFragment.d.ts +14 -0
  38. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListSelector/PriceListSelector.d.ts +3 -0
  39. package/dist/cjs/types/src/components/Subscriptions/Upgrade/queries/getSubscriptions.d.ts +2 -163
  40. package/dist/cjs/types/src/components/Subscriptions/context/upgradingSubscriptionContext.d.ts +9 -1
  41. package/dist/cjs/types/src/components/Subscriptions/fragments/UpgradingSubscriptionContext_SubscriptionFragment.d.ts +4 -0
  42. package/dist/cjs/types/src/hooks/usePaymentMethod.d.ts +4 -0
  43. package/dist/cjs/types/src/utils/chargeUtils.d.ts +1 -0
  44. package/dist/cjs/types/src/utils/featureAddonUtils/isAddonPurchased.d.ts +1 -1
  45. package/dist/esm/index.js +5419 -5424
  46. package/dist/esm/types/src/components/PaymentForm/DemoPay/DemoPayFormProvider.d.ts +10 -0
  47. package/dist/esm/types/src/components/PaymentForm/DemoPay/hooks/usePay.d.ts +2 -4
  48. package/dist/esm/types/src/components/PaymentForm/DemoPay/hooks/useSave.d.ts +1 -5
  49. package/dist/esm/types/src/components/PaymentForm/PaymentForm.d.ts +40 -9
  50. package/dist/esm/types/src/components/PaymentForm/Stripe/StripeFormProvider.d.ts +5 -0
  51. package/dist/esm/types/src/components/PaymentForm/Stripe/hooks/usePay.d.ts +2 -4
  52. package/dist/esm/types/src/components/PaymentForm/components/CheckoutNoPayment.d.ts +6 -0
  53. package/dist/esm/types/src/components/PaymentForm/components/Pay.d.ts +5 -0
  54. package/dist/esm/types/src/components/PaymentForm/components/PaymentMethodDetails/PaymentMethodDetails.d.ts +12 -0
  55. package/dist/esm/types/src/components/PaymentForm/components/PaymentMethodDetails/components/Cancel.d.ts +1 -0
  56. package/dist/esm/types/src/components/PaymentForm/components/PaymentMethodDetails/components/Save.d.ts +1 -0
  57. package/dist/esm/types/src/components/PaymentForm/components/StoredPaymentMethods.d.ts +18 -0
  58. package/dist/esm/types/src/components/PaymentForm/context/AccountIdContext.d.ts +5 -0
  59. package/dist/esm/types/src/components/PaymentForm/context/CallbacksContext.d.ts +14 -0
  60. package/dist/esm/types/src/components/PaymentForm/context/PaymentMethodFormVisibilityContext.d.ts +12 -0
  61. package/dist/esm/types/src/components/PaymentForm/context/PaymentProvider.d.ts +46 -37
  62. package/dist/esm/types/src/components/PaymentForm/hooks/usePay.d.ts +14 -0
  63. package/dist/esm/types/src/components/PaymentForm/hooks/usePaymentButtonText.d.ts +7 -1
  64. package/dist/esm/types/src/components/PaymentForm/hooks/usePaymentHold.d.ts +18 -0
  65. package/dist/esm/types/src/components/PaymentForm/hooks/useSave.d.ts +16 -0
  66. package/dist/esm/types/src/components/PaymentForm/types/PaymentType.d.ts +2 -1
  67. package/dist/esm/types/src/components/QuoteProvider/context/quantityEditableChargesContext.d.ts +2 -8
  68. package/dist/esm/types/src/components/QuoteProvider/fragments/quoteFragment.d.ts +5 -3
  69. package/dist/esm/types/src/components/QuoteProvider/fragments/useQuantityEditableCharges_PriceListChargeFragment.d.ts +16 -0
  70. package/dist/esm/types/src/components/QuoteProvider/fragments/useQuantityEditableCharges_QuoteFragment.d.ts +26 -0
  71. package/dist/esm/types/src/components/QuoteProvider/fragments/useQuoteQuantities_PriceListChargeFragment.d.ts +13 -0
  72. package/dist/esm/types/src/components/QuoteProvider/hooks/useQuantityEditableCharges.d.ts +41 -36
  73. package/dist/esm/types/src/components/QuoteProvider/hooks/useQuoteCreate.d.ts +14 -3
  74. package/dist/esm/types/src/components/QuoteProvider/hooks/useQuoteQuantities.d.ts +3 -19
  75. package/dist/esm/types/src/components/QuoteProvider/hooks/useSelectedPriceListQuoteChange.d.ts +18 -30
  76. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/checkoutBar/CheckoutBarInput/CheckoutBarInput.d.ts +1 -13
  77. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/checkoutBar/CheckoutBarInput/fragments/CheckoutBarInput_PriceListChargeFragment.d.ts +13 -0
  78. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/checkoutBar/CheckoutBarInput/fragments/useChargeCRUD_QuoteFragment.d.ts +22 -0
  79. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/checkoutBar/CheckoutBarInput/hooks/useChargeCRUD.d.ts +1 -1
  80. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/checkoutBar/PlanPickerCheckoutBar.d.ts +0 -14
  81. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/checkoutBar/fragments/PlanPickerCheckoutBar_PriceListChargeFragment.d.ts +14 -0
  82. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/priceListSelector/PriceListSelector.d.ts +3 -0
  83. package/dist/esm/types/src/components/Subscriptions/Upgrade/queries/getSubscriptions.d.ts +2 -163
  84. package/dist/esm/types/src/components/Subscriptions/context/upgradingSubscriptionContext.d.ts +9 -1
  85. package/dist/esm/types/src/components/Subscriptions/fragments/UpgradingSubscriptionContext_SubscriptionFragment.d.ts +4 -0
  86. package/dist/esm/types/src/hooks/usePaymentMethod.d.ts +4 -0
  87. package/dist/esm/types/src/utils/chargeUtils.d.ts +1 -0
  88. package/dist/esm/types/src/utils/featureAddonUtils/isAddonPurchased.d.ts +1 -1
  89. package/dist/index.d.ts +64 -9
  90. package/package.json +1 -1
  91. package/dist/cjs/types/src/components/PaymentForm/components/CheckoutFooter.d.ts +0 -2
  92. package/dist/cjs/types/src/components/PaymentForm/components/PaymentMethodDetails.d.ts +0 -2
  93. package/dist/cjs/types/src/components/PaymentForm/components/PaymentMethodFooter.d.ts +0 -4
  94. package/dist/cjs/types/src/components/PaymentForm/hooks/useHandlePayment.d.ts +0 -41
  95. package/dist/esm/types/src/components/PaymentForm/components/CheckoutFooter.d.ts +0 -2
  96. package/dist/esm/types/src/components/PaymentForm/components/PaymentMethodDetails.d.ts +0 -2
  97. package/dist/esm/types/src/components/PaymentForm/components/PaymentMethodFooter.d.ts +0 -4
  98. package/dist/esm/types/src/components/PaymentForm/hooks/useHandlePayment.d.ts +0 -41
  99. /package/dist/cjs/types/src/components/PaymentForm/components/{PaymentMethodSelector.d.ts → PaymentMethodDetails/components/PaymentMethodSelector.d.ts} +0 -0
  100. /package/dist/esm/types/src/components/PaymentForm/components/{PaymentMethodSelector.d.ts → PaymentMethodDetails/components/PaymentMethodSelector.d.ts} +0 -0
@@ -1,19 +1,5 @@
1
- import PriceList from '@/types/PriceList';
2
- import { FragmentOf, ResultOf } from 'gql.tada';
3
- import { QuoteContext_QuoteFragment } from '../fragments/quoteFragment';
4
- export declare const useQuoteQuantities_PriceListChargeFragment: import("gql.tada").TadaDocumentNode<{
5
- feature: {
6
- id: string;
7
- } | null;
8
- id: string;
9
- quantityMax: number | null;
10
- quantityMin: number | null;
11
- selfServiceQuantity: boolean | null;
12
- }, {}, {
13
- fragment: "useQuoteQuantities_PriceListChargeFragment";
14
- on: "PriceListCharge";
15
- masked: true;
16
- }>;
1
+ import { FragmentOf } from 'gql.tada';
2
+ import { useQuoteQuantities_PriceListChargeFragment } from '../fragments/useQuoteQuantities_PriceListChargeFragment';
17
3
  export declare const useQuoteQuantities_SubscriptionFragment: import("gql.tada").TadaDocumentNode<{
18
4
  currentCharges: {
19
5
  id: string | null;
@@ -24,9 +10,7 @@ export declare const useQuoteQuantities_SubscriptionFragment: import("gql.tada")
24
10
  on: "Subscription";
25
11
  masked: true;
26
12
  }>;
27
- export declare const useQuoteQuantities: ({ selectedPriceList, quote, quantityEditableCharges: maskedQuantityEditableCharges, }: {
28
- selectedPriceList: PriceList;
29
- quote: ResultOf<typeof QuoteContext_QuoteFragment> | null | undefined;
13
+ export declare const useQuoteQuantities: ({ quantityEditableCharges: maskedQuantityEditableCharges, }: {
30
14
  quantityEditableCharges: FragmentOf<typeof useQuoteQuantities_PriceListChargeFragment>[] | undefined;
31
15
  }) => {
32
16
  onChangeQuantity: (priceListChargeId: string, quantity: number) => void;
@@ -1,37 +1,25 @@
1
- import { FragmentOf, ResultOf } from 'gql.tada';
2
- import { QuoteContext_QuoteFragment } from '../fragments/quoteFragment';
3
- export declare const useSelectedPriceListQuoteChange_PriceListFragment: import("gql.tada").TadaDocumentNode<{
4
- id: string;
1
+ import { FragmentOf } from 'gql.tada';
2
+ export declare const useSelectedPriceListQuoteChange_QuoteFragment: import("gql.tada").TadaDocumentNode<{
3
+ quoteChanges: {
4
+ id: string | null;
5
+ }[] | null;
5
6
  }, {}, {
6
- fragment: "useSelectedPriceListQuoteChange_PriceListFragment";
7
- on: "PriceList";
7
+ fragment: "useSelectedPriceListQuoteChange_QuoteFragment";
8
+ on: "Quote";
8
9
  masked: true;
9
10
  }>;
10
- export declare function useSelectedPriceListQuoteChange({ quote, selectedPriceList: maskedSelectedPriceList, }: {
11
- quote: ResultOf<typeof QuoteContext_QuoteFragment> | null | undefined;
12
- selectedPriceList: FragmentOf<typeof useSelectedPriceListQuoteChange_PriceListFragment> | null;
13
- }): {
11
+ export declare const useSelectedPriceListQuoteChange_QuoteChangeFragment: import("gql.tada").TadaDocumentNode<{
14
12
  id: string | null;
15
- kind: "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "COUPON" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | "ACTIVATE";
16
13
  priceList: {
17
14
  id: string;
18
15
  } | null;
19
- charges: {
20
- priceListCharge: {
21
- id: string;
22
- chargeType: "ONE_TIME" | "RECURRING" | "USAGE" | null;
23
- pricingModel: "FLAT" | "TIERED" | "VOLUME" | "BANDS" | null;
24
- quantityMin: number | null;
25
- quantityMax: number | null;
26
- selfServiceQuantity: boolean | null;
27
- [$tada.fragmentRefs]: {
28
- CanEditChargeQuantity_PriceListChargeFragment: "PriceListCharge";
29
- };
30
- } | null;
31
- feature: {
32
- id: string;
33
- } | null;
34
- quantity: number | null;
35
- id: string | null;
36
- }[];
37
- } | undefined;
16
+ kind: "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "COUPON" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | "ACTIVATE";
17
+ }, {}, {
18
+ fragment: "useSelectedPriceListQuoteChange_QuoteChangeFragment";
19
+ on: "QuoteChange";
20
+ masked: true;
21
+ }>;
22
+ export declare function useSelectedPriceListQuoteChange<T extends FragmentOf<typeof useSelectedPriceListQuoteChange_QuoteChangeFragment>>({ quoteChanges: maskedQuoteChanges, selectedPriceListId, }: {
23
+ quoteChanges: T[] | undefined | null;
24
+ selectedPriceListId: string | undefined;
25
+ }): T | undefined;
@@ -1,17 +1,5 @@
1
1
  import { FragmentOf } from 'gql.tada';
2
- export declare const CheckoutBarInput_PriceListChargeFragment: import("gql.tada").TadaDocumentNode<{
3
- name: string;
4
- quantityMin: number | null;
5
- quantityMax: number | null;
6
- id: string;
7
- feature: {
8
- id: string;
9
- } | null;
10
- }, {}, {
11
- fragment: "CheckoutBarInput_PriceListChargeFragment";
12
- on: "PriceListCharge";
13
- masked: true;
14
- }>;
2
+ import { CheckoutBarInput_PriceListChargeFragment } from './fragments/CheckoutBarInput_PriceListChargeFragment';
15
3
  declare const CheckoutBarInput: ({ disabled, priceListCharge: maskedPriceListCharge, quantity, onQuantityChanged, }: {
16
4
  disabled?: boolean;
17
5
  priceListCharge: FragmentOf<typeof CheckoutBarInput_PriceListChargeFragment>;
@@ -0,0 +1,13 @@
1
+ export declare const CheckoutBarInput_PriceListChargeFragment: import("gql.tada").TadaDocumentNode<{
2
+ name: string;
3
+ quantityMin: number | null;
4
+ quantityMax: number | null;
5
+ id: string;
6
+ feature: {
7
+ id: string;
8
+ } | null;
9
+ }, {}, {
10
+ fragment: "CheckoutBarInput_PriceListChargeFragment";
11
+ on: "PriceListCharge";
12
+ masked: true;
13
+ }>;
@@ -0,0 +1,22 @@
1
+ export declare const useChargeCRUD_QuoteFragment: import("gql.tada").TadaDocumentNode<{
2
+ id: string | null;
3
+ startDate: unknown;
4
+ quoteChanges: {
5
+ subscriptionId: string | null;
6
+ charges: {
7
+ id: string | null;
8
+ quantity: number | null;
9
+ priceListCharge: {
10
+ id: string;
11
+ } | null;
12
+ }[];
13
+ id: string | null;
14
+ [$tada.fragmentRefs]: {
15
+ useSelectedPriceListQuoteChange_QuoteChangeFragment: "QuoteChange";
16
+ };
17
+ }[] | null;
18
+ }, {}, {
19
+ fragment: "useChargeCRUD_QuoteFragment";
20
+ on: "Quote";
21
+ masked: true;
22
+ }>;
@@ -23,7 +23,7 @@ export declare const useChargeCRUD_SubscriptionFragment: import("gql.tada").Tada
23
23
  *
24
24
  * All network operations are debounced.
25
25
  */
26
- export declare const useChargeCRUD: ({ priceListChargeId, featureId }: {
26
+ export declare const useChargeCRUD: ({ priceListChargeId, featureId, }: {
27
27
  priceListChargeId: string;
28
28
  featureId: string | undefined;
29
29
  }) => {
@@ -1,18 +1,4 @@
1
1
  import PriceList from '@/types/PriceList';
2
- export declare const PlanPickerCheckoutBar_PriceListChargeFragment: import("gql.tada").TadaDocumentNode<{
3
- [$tada.fragmentRefs]: {
4
- CheckoutBarInput_PriceListChargeFragment: "PriceListCharge";
5
- };
6
- feature: {
7
- id: string;
8
- } | null;
9
- featureAddon: boolean | null;
10
- id: string;
11
- }, {}, {
12
- fragment: "PlanPickerCheckoutBar_PriceListChargeFragment";
13
- on: "PriceListCharge";
14
- masked: true;
15
- }>;
16
2
  declare const PlanPickerCheckoutBar: ({ selectedPriceList, handlePortalErrors, onCheckoutSuccess, }: {
17
3
  selectedPriceList: PriceList;
18
4
  handlePortalErrors?: (errors: any) => void;
@@ -0,0 +1,14 @@
1
+ export declare const PlanPickerCheckoutBar_PriceListChargeFragment: import("gql.tada").TadaDocumentNode<{
2
+ [$tada.fragmentRefs]: {
3
+ CheckoutBarInput_PriceListChargeFragment: "PriceListCharge";
4
+ };
5
+ feature: {
6
+ id: string;
7
+ } | null;
8
+ featureAddon: boolean | null;
9
+ id: string;
10
+ }, {}, {
11
+ fragment: "PlanPickerCheckoutBar_PriceListChargeFragment";
12
+ on: "PriceListCharge";
13
+ masked: true;
14
+ }>;
@@ -9,6 +9,9 @@ export declare const PriceListSelectorUpgradingSubscription_SubscriptionFragment
9
9
  addon: boolean | null;
10
10
  } | null;
11
11
  } | null;
12
+ [$tada.fragmentRefs]: {
13
+ createAvailableBillingPeriods_SubscriptionFragment: "Subscription";
14
+ };
12
15
  }, {}, {
13
16
  fragment: "PriceListSelectorUpgradingSubscription_SubscriptionFragment";
14
17
  on: "Subscription";
@@ -5,171 +5,10 @@ export declare const getSubscriptions: ({ apiHost, isInPreviewMode, token, }: {
5
5
  }) => Promise<{
6
6
  subscriptions: {
7
7
  nodes: ({
8
- addonSubscriptions: {
9
- id: string;
10
- priceList: {
11
- id: string;
12
- } | null;
13
- plan: {
14
- id: string;
15
- } | null;
16
- }[] | null;
17
- cancellationDate: unknown;
18
- currencyId: string;
19
- endDate: unknown;
20
- evergreen: boolean;
21
8
  id: string;
22
- period: string;
23
- account: {
24
- id: string;
9
+ [$tada.fragmentRefs]: {
10
+ UpgradingSubscriptionContext_SubscriptionFragment: "Subscription";
25
11
  };
26
- daysLeftInTrial: number | null;
27
- plan: {
28
- id: string;
29
- name: string;
30
- selfServiceBuy: boolean | null;
31
- selfServiceCancel: boolean | null;
32
- selfServiceRenew: boolean | null;
33
- } | null;
34
- priceList: {
35
- id: string;
36
- periodMonths: number | null;
37
- name: string;
38
- plan: {
39
- id: string;
40
- addon: boolean | null;
41
- addonPlans: {
42
- id: string;
43
- }[] | null;
44
- } | null;
45
- } | null;
46
- product: {
47
- id: string;
48
- name: string;
49
- showProductNameOnLineItem: boolean | null;
50
- } | null;
51
- startDate: unknown;
52
- state: "ACTIVE" | "TRIAL" | "CANCELED" | "EXPIRED" | "TRIAL_EXPIRED" | "PENDING";
53
- trialEndDate: unknown;
54
- trialPeriod: string;
55
- trialStartDate: unknown;
56
- trialExpirationAction: "ACTIVATE" | "CANCEL" | null;
57
- charges: {
58
- priceListCharge: {
59
- priceListChargeTiers: {
60
- price: number | null;
61
- starts: number | null;
62
- }[] | null;
63
- featureAddon: boolean | null;
64
- id: string;
65
- } | null;
66
- amount: number | null;
67
- billingPeriod: "MONTHLY" | "QUARTERLY" | "SEMI_ANNUAL" | "ANNUAL" | "ONCE" | null;
68
- chargeType: "ONE_TIME" | "RECURRING" | "USAGE" | null;
69
- discount: number | null;
70
- discountedPrice: string | null;
71
- endDate: unknown;
72
- expired: boolean;
73
- feature: {
74
- name: string;
75
- } | null;
76
- id: string | null;
77
- isAmendment: boolean;
78
- isRamp: boolean;
79
- kind: "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "COUPON" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | "ACTIVATE" | null;
80
- name: string | null;
81
- periodPrice: number | null;
82
- price: string | null;
83
- priceDecimals: number | null;
84
- priceListChargeId: string | null;
85
- priceTiers: {
86
- starts: number | null;
87
- price: number | null;
88
- }[] | null;
89
- pricingModel: "FLAT" | "TIERED" | "VOLUME" | "BANDS" | null;
90
- quantity: number | null;
91
- selfServiceQuantity: boolean | null;
92
- startDate: unknown;
93
- trial: boolean;
94
- }[] | null;
95
- chargeReport: {
96
- priceListCharge: {
97
- priceListChargeTiers: {
98
- price: number | null;
99
- starts: number | null;
100
- }[] | null;
101
- featureAddon: boolean | null;
102
- id: string;
103
- code: string | null;
104
- } | null;
105
- amount: number | null;
106
- billingPeriod: "MONTHLY" | "QUARTERLY" | "SEMI_ANNUAL" | "ANNUAL" | "ONCE" | null;
107
- chargeType: "ONE_TIME" | "RECURRING" | "USAGE" | null;
108
- discount: number | null;
109
- discountedPrice: string | null;
110
- endDate: unknown;
111
- expired: boolean;
112
- feature: {
113
- name: string;
114
- } | null;
115
- id: string | null;
116
- isAmendment: boolean;
117
- isRamp: boolean;
118
- kind: "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "COUPON" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | "ACTIVATE" | null;
119
- name: string | null;
120
- periodPrice: number | null;
121
- price: string | null;
122
- priceDecimals: number | null;
123
- priceListChargeId: string | null;
124
- priceTiers: {
125
- starts: number | null;
126
- price: number | null;
127
- }[] | null;
128
- pricingModel: "FLAT" | "TIERED" | "VOLUME" | "BANDS" | null;
129
- quantity: number | null;
130
- selfServiceQuantity: boolean | null;
131
- startDate: unknown;
132
- trial: boolean;
133
- }[] | null;
134
- currentCharges: {
135
- priceListCharge: {
136
- priceListChargeTiers: {
137
- price: number | null;
138
- starts: number | null;
139
- }[] | null;
140
- featureAddon: boolean | null;
141
- id: string;
142
- code: string | null;
143
- } | null;
144
- amount: number | null;
145
- billingPeriod: "MONTHLY" | "QUARTERLY" | "SEMI_ANNUAL" | "ANNUAL" | "ONCE" | null;
146
- chargeType: "ONE_TIME" | "RECURRING" | "USAGE" | null;
147
- discount: number | null;
148
- discountedPrice: string | null;
149
- endDate: unknown;
150
- expired: boolean;
151
- feature: {
152
- name: string;
153
- } | null;
154
- id: string | null;
155
- isAmendment: boolean;
156
- isRamp: boolean;
157
- kind: "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "COUPON" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | "ACTIVATE" | null;
158
- name: string | null;
159
- periodPrice: number | null;
160
- price: string | null;
161
- priceDecimals: number | null;
162
- priceListChargeId: string | null;
163
- priceTiers: {
164
- starts: number | null;
165
- price: number | null;
166
- }[] | null;
167
- pricingModel: "FLAT" | "TIERED" | "VOLUME" | "BANDS" | null;
168
- quantity: number | null;
169
- selfServiceQuantity: boolean | null;
170
- startDate: unknown;
171
- trial: boolean;
172
- }[] | null;
173
12
  } | null)[] | null;
174
13
  } | null;
175
14
  }>;
@@ -25,8 +25,12 @@ export declare const UpgradingSubscriptionProvider: ({ value, children }: {
25
25
  useChargeCRUD_SubscriptionFragment: "Subscription";
26
26
  } & {
27
27
  useQuoteQuantities_SubscriptionFragment: "Subscription";
28
+ } & {
29
+ isAddonPurchased_SubscriptionChargeFragment: "Subscription";
30
+ } & {
31
+ useQuoteCreate_SubscriptionFragment: "Subscription";
28
32
  };
29
- } | undefined;
33
+ } | null | undefined;
30
34
  children?: import("react").ReactNode;
31
35
  }) => import("react/jsx-runtime").JSX.Element, useUpgradingSubscription: () => {
32
36
  id: string;
@@ -54,5 +58,9 @@ export declare const UpgradingSubscriptionProvider: ({ value, children }: {
54
58
  useChargeCRUD_SubscriptionFragment: "Subscription";
55
59
  } & {
56
60
  useQuoteQuantities_SubscriptionFragment: "Subscription";
61
+ } & {
62
+ isAddonPurchased_SubscriptionChargeFragment: "Subscription";
63
+ } & {
64
+ useQuoteCreate_SubscriptionFragment: "Subscription";
57
65
  };
58
66
  } | undefined;
@@ -24,6 +24,10 @@ export declare const UpgradingSubscriptionContext_SubscriptionFragment: import("
24
24
  useChargeCRUD_SubscriptionFragment: "Subscription";
25
25
  } & {
26
26
  useQuoteQuantities_SubscriptionFragment: "Subscription";
27
+ } & {
28
+ isAddonPurchased_SubscriptionChargeFragment: "Subscription";
29
+ } & {
30
+ useQuoteCreate_SubscriptionFragment: "Subscription";
27
31
  };
28
32
  }, {}, {
29
33
  fragment: "UpgradingSubscriptionContext_SubscriptionFragment";
@@ -23,6 +23,8 @@ export declare const usePaymentMethod: ({ accountId, enabled, }: {
23
23
  isDefault: boolean | null;
24
24
  [$tada.fragmentRefs]: {
25
25
  PaymentForm_PaymentMethodsFragment: "PaymentMethod";
26
+ } & {
27
+ StoredPaymentMethods_PaymentMethodsFragment: "PaymentMethod";
26
28
  };
27
29
  }[] | undefined;
28
30
  defaultPaymentMethod: {
@@ -46,6 +48,8 @@ export declare const usePaymentMethod: ({ accountId, enabled, }: {
46
48
  isDefault: boolean | null;
47
49
  [$tada.fragmentRefs]: {
48
50
  PaymentForm_PaymentMethodsFragment: "PaymentMethod";
51
+ } & {
52
+ StoredPaymentMethods_PaymentMethodsFragment: "PaymentMethod";
49
53
  };
50
54
  } | undefined;
51
55
  isLoading: boolean;
@@ -2,6 +2,7 @@ import { FragmentOf } from 'gql.tada';
2
2
  export declare const CanEditChargeQuantity_PriceListChargeFragment: import("gql.tada").TadaDocumentNode<{
3
3
  chargeType: "ONE_TIME" | "RECURRING" | "USAGE" | null;
4
4
  pricingModel: "FLAT" | "TIERED" | "VOLUME" | "BANDS" | null;
5
+ selfServiceQuantity: boolean | null;
5
6
  }, {}, {
6
7
  fragment: "CanEditChargeQuantity_PriceListChargeFragment";
7
8
  on: "PriceListCharge";
@@ -21,4 +21,4 @@ export declare const isAddonPurchased_SubscriptionChargeFragment: import("gql.ta
21
21
  on: "Subscription";
22
22
  masked: true;
23
23
  }>;
24
- export declare function isAddonPurchased(maskedFeatureAddon: FragmentOf<typeof isAddonPurchased_PriceListChargeFragment>, maskedCurrentSubscription: FragmentOf<typeof isAddonPurchased_SubscriptionChargeFragment>): boolean;
24
+ export declare function isAddonPurchased(maskedFeatureAddon: FragmentOf<typeof isAddonPurchased_PriceListChargeFragment>, maskedCurrentSubscription: FragmentOf<typeof isAddonPurchased_SubscriptionChargeFragment> | undefined): boolean;
package/dist/index.d.ts CHANGED
@@ -3,10 +3,9 @@ import * as gql_tada from 'gql.tada';
3
3
  import { ResultOf, FragmentOf } from 'gql.tada';
4
4
  import FormattedInvoice from '@/types/FormattedInvoice';
5
5
  import { Transaction, TransactionKind } from '@/types/Transaction';
6
- import Invoice$1 from '@/types/Invoice';
6
+ import react, { ReactNode, ComponentProps } from 'react';
7
7
  import { QueryClient } from '@tanstack/react-query';
8
8
  import { ThemeConfig } from 'antd';
9
- import react from 'react';
10
9
 
11
10
  type ShadowType = "shadow-none" | "shadow-sm" | "shadow-md" | "shadow-lg" | "shadow-xl";
12
11
 
@@ -94,6 +93,35 @@ declare function Quotes({ className, columns, filter, filterQuotes, sort, noQuot
94
93
  noQuotesMessage?: string;
95
94
  }): react_jsx_runtime.JSX.Element;
96
95
 
96
+ type Props = {
97
+ className?: string;
98
+ disabled?: boolean;
99
+ };
100
+ declare function CheckoutNoPayment(props?: Props): react_jsx_runtime.JSX.Element;
101
+
102
+ type PayProps = {
103
+ disabled?: boolean;
104
+ };
105
+ declare function Pay(props?: PayProps): react_jsx_runtime.JSX.Element;
106
+
107
+ declare function Cancel(): react_jsx_runtime.JSX.Element;
108
+
109
+ declare function Save(): react_jsx_runtime.JSX.Element;
110
+
111
+ type PaymentMethodDetailsProps = {
112
+ footer?: ReactNode;
113
+ };
114
+ declare function PaymentMethodDetailsRoot(props?: PaymentMethodDetailsProps): react_jsx_runtime.JSX.Element;
115
+ declare const PaymentMethodDetails: typeof PaymentMethodDetailsRoot & {
116
+ Cancel: typeof Cancel;
117
+ Save: typeof Save;
118
+ };
119
+
120
+ type StoredPaymentMethodsProps = {
121
+ className?: string;
122
+ };
123
+ declare function StoredPaymentMethods(props?: StoredPaymentMethodsProps): react_jsx_runtime.JSX.Element;
124
+
97
125
  declare const PaymentForm_PaymentMethodsFragment: gql_tada.TadaDocumentNode<{
98
126
  [$tada.fragmentRefs]: {
99
127
  MiniCreditCard_PaymentMethodFragment: "PaymentMethod";
@@ -120,10 +148,25 @@ declare const PaymentForm_QuoteFragment: gql_tada.TadaDocumentNode<{
120
148
  on: "Quote";
121
149
  masked: true;
122
150
  }>;
123
- declare function PaymentForm({ currencyId: accountCurrencyId, invoice, quote: maskedQuote, onPaymentSuccess, onPaymentHoldSuccess, paymentHoldPrecondition, accountId, onSavePaymentMethod, onPaymentMethodRemoved, onSetDefaultPaymentMethod, overrideToken, customCheckoutFunction, paymentHoldOptions, disablePayButton, }: {
151
+ declare const PaymentForm_InvoiceFragment: gql_tada.TadaDocumentNode<{
152
+ id: string | null;
153
+ currencyId: string;
154
+ [$tada.fragmentRefs]: {
155
+ PaymentProvider_InvoiceFragment: "Invoice";
156
+ };
157
+ }, {}, {
158
+ fragment: "PaymentForm_InvoiceFragment";
159
+ on: "Invoice";
160
+ masked: true;
161
+ }>;
162
+ declare function PaymentFormRoot({ currencyId: accountCurrencyId, invoice: maskedInvoice, quote: maskedQuote, paymentHold, onPaymentSuccess, onPaymentHoldSuccess, paymentHoldPrecondition, accountId, onSavePaymentMethod, onPaymentMethodRemoved, onSetDefaultPaymentMethod, overrideToken, customCheckoutFunction, children, }: {
124
163
  currencyId?: string;
125
- invoice?: FormattedInvoice | Invoice$1;
164
+ invoice?: FragmentOf<typeof PaymentForm_InvoiceFragment>;
126
165
  quote?: FragmentOf<typeof PaymentForm_QuoteFragment>;
166
+ paymentHold?: {
167
+ quoteId: string;
168
+ amountToHold: number;
169
+ };
127
170
  onPaymentSuccess?: (response: any) => void;
128
171
  onPaymentHoldSuccess?: (response: any) => void;
129
172
  /**
@@ -136,12 +179,24 @@ declare function PaymentForm({ currencyId: accountCurrencyId, invoice, quote: ma
136
179
  accountId?: string;
137
180
  overrideToken?: string;
138
181
  customCheckoutFunction?: (pluginId: string, paymentMethodId: string) => Promise<any>;
139
- paymentHoldOptions?: {
140
- payToAccept?: boolean;
141
- amountToHold?: number;
142
- };
143
- disablePayButton?: boolean;
182
+ children?: ReactNode | ((state: PaymentFormRenderState) => ReactNode);
144
183
  }): react_jsx_runtime.JSX.Element | null;
184
+ type PaymentFormProps = ComponentProps<typeof PaymentFormRoot>;
185
+ type PaymentFormRenderState = {
186
+ hasPaymentMethods: boolean;
187
+ isPaymentMethodDetailsOpen: boolean;
188
+ isPayableAvailable: boolean;
189
+ amountDue: number | undefined;
190
+ };
191
+ declare function PaymentFormInternal(props: PaymentFormProps & {
192
+ disablePayButton?: boolean;
193
+ }): react_jsx_runtime.JSX.Element;
194
+ declare const PaymentForm: typeof PaymentFormInternal & {
195
+ StoredPaymentMethods: typeof StoredPaymentMethods;
196
+ Pay: typeof Pay;
197
+ CheckoutNoPayment: typeof CheckoutNoPayment;
198
+ PaymentMethodDetails: typeof PaymentMethodDetails;
199
+ };
145
200
 
146
201
  declare function Signup({ companyName, priceListCode, returnUrl, couponCode, className, shadow, style, defaultFirstName, defaultLastName, defaultEmail, defaultCompanyName, defaultBillingCountry, }: {
147
202
  /** The company name to display on the signup page */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bunnyapp/components",
3
- "version": "1.8.0-beta.7",
3
+ "version": "1.8.0-beta.9",
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",
@@ -1,2 +0,0 @@
1
- declare const CheckoutFooter: () => import("react/jsx-runtime").JSX.Element;
2
- export default CheckoutFooter;
@@ -1,2 +0,0 @@
1
- declare const PaymentMethodDetails: () => import("react/jsx-runtime").JSX.Element;
2
- export default PaymentMethodDetails;
@@ -1,4 +0,0 @@
1
- export declare function PaymentMethodFooter({ onSubmit, noPadding, }: {
2
- onSubmit: () => void;
3
- noPadding?: boolean;
4
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,41 +0,0 @@
1
- import FormattedInvoice from '@/types/FormattedInvoice';
2
- import Invoice from '@/types/Invoice';
3
- import { PluginData } from '@/types/frontendTypes';
4
- import { FragmentOf } from 'gql.tada';
5
- import { PaymentType } from '../types/PaymentType';
6
- export declare const useHandlePayment_QuoteFragment: import("gql.tada").TadaDocumentNode<{
7
- id: string | null;
8
- amount: number;
9
- currencyId: string;
10
- [$tada.fragmentRefs]: {
11
- getQuoteAmountDue_QuoteFragment: "Quote";
12
- };
13
- }, {}, {
14
- fragment: "useHandlePayment_QuoteFragment";
15
- on: "Quote";
16
- masked: true;
17
- }>;
18
- declare const useHandlePayment: ({ quote: maskedQuote, invoice, onPaymentSuccess, onPaymentHoldSuccess, paymentHoldPrecondition, plugin, paymentHoldOptions, accountId, }: {
19
- quote?: FragmentOf<typeof useHandlePayment_QuoteFragment>;
20
- invoice?: FormattedInvoice | Invoice;
21
- onPaymentSuccess?: (response: any) => void;
22
- onPaymentHoldSuccess?: (response: any) => void;
23
- paymentHoldPrecondition?: () => boolean | Promise<boolean>;
24
- plugin: PluginData | undefined;
25
- paymentHoldOptions: {
26
- payToAccept?: boolean;
27
- amountToHold?: number;
28
- };
29
- accountId: string | undefined;
30
- }) => {
31
- handleApproveHold: (overridePaymentMethodId?: string) => Promise<void>;
32
- handlePayment: (overridePaymentMethodId: string) => Promise<void>;
33
- handleCheckoutNoPayment: import("@tanstack/react-query").UseMutateFunction<{
34
- savePaymentMethod: boolean | undefined;
35
- }, Error, void, unknown>;
36
- isPaying: boolean;
37
- isPaid: boolean;
38
- paymentType: PaymentType;
39
- formattedAmountDue: string | undefined;
40
- };
41
- export default useHandlePayment;
@@ -1,2 +0,0 @@
1
- declare const CheckoutFooter: () => import("react/jsx-runtime").JSX.Element;
2
- export default CheckoutFooter;
@@ -1,2 +0,0 @@
1
- declare const PaymentMethodDetails: () => import("react/jsx-runtime").JSX.Element;
2
- export default PaymentMethodDetails;
@@ -1,4 +0,0 @@
1
- export declare function PaymentMethodFooter({ onSubmit, noPadding, }: {
2
- onSubmit: () => void;
3
- noPadding?: boolean;
4
- }): import("react/jsx-runtime").JSX.Element;