@bunnyapp/components 1.6.0-beta.14 → 1.6.0-beta.16

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/README.md +42 -0
  2. package/dist/cjs/index.js +2521 -2191
  3. package/dist/cjs/types/src/components/BunnyProvider.d.ts +0 -2
  4. package/dist/cjs/types/src/components/Checkout/Checkout.d.ts +1 -1
  5. package/dist/cjs/types/src/components/Checkout/QuoteCheckout.d.ts +4 -4
  6. package/dist/cjs/types/src/components/QuoteProvider/fragments/quoteFieldsFragment.d.ts +65 -0
  7. package/dist/cjs/types/src/components/QuoteProvider/fragments/quoteFragment.d.ts +16 -112
  8. package/dist/cjs/types/src/components/QuoteProvider/hooks/useFeatureQuantities.d.ts +12 -0
  9. package/dist/cjs/types/src/components/QuoteProvider/hooks/useQuoteQuantities.d.ts +0 -5
  10. package/dist/cjs/types/src/components/QuoteProvider/mutations/quoteChangeUpdate.d.ts +16 -0
  11. package/dist/cjs/types/src/components/QuoteProvider/utils/getQuantityFromQuoteChange.d.ts +11 -0
  12. package/dist/cjs/types/src/components/QuoteProvider/utils/quoteChangeCanBeEdited.d.ts +4 -0
  13. package/dist/cjs/types/src/components/Subscriptions/Subscriptions.d.ts +1 -5
  14. package/dist/cjs/types/src/components/Subscriptions/SubscriptionsListContainer.d.ts +0 -4
  15. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/PlanPicker.d.ts +1 -2
  16. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/checkoutBar/PlanPickerCheckoutBar.d.ts +19 -0
  17. package/dist/cjs/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/planManagerUtils.d.ts +5 -2
  18. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/QuantityChangeGridRow.d.ts +1 -5
  19. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/QuantityDrawer.d.ts +1 -4
  20. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/QuoteChangeSummarySection.d.ts +11 -6
  21. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/context/quoteIdContext.d.ts +5 -0
  22. package/dist/{esm/types/src/components/Subscriptions/quantityChangeDrawer/fragments/QuantityDrawerQuoteFragment.d.ts → cjs/types/src/components/Subscriptions/quantityChangeDrawer/fragments/QuantityDrawer_QuoteFragment.d.ts} +4 -0
  23. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/hooks/useQuoteQueryData.d.ts +3 -3
  24. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/hooks/useSetQuoteQueryData.d.ts +2 -2
  25. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/quantityChangeDrawerDesktop/QuantityChangeDrawerDesktop.d.ts +1 -6
  26. package/dist/{esm/types/src/components/Subscriptions/quantityChangeDrawer → cjs/types/src/components/Subscriptions/quantityChangeDrawer/quantityInput}/QuantityInput.d.ts +2 -9
  27. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/quantityInput/fragments/QuantityInput_QuoteFragment.d.ts +27 -0
  28. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/utils/utils.d.ts +3 -2
  29. package/dist/cjs/types/src/components/Subscriptions/subscriptionsList/SubscriptionChargeTotal.d.ts +3 -3
  30. package/dist/cjs/types/src/components/Subscriptions/subscriptionsList/subscriptionCardHeader/components/SubscriptionCardActions.d.ts +21 -0
  31. package/dist/cjs/types/src/components/Subscriptions/subscriptionsList/subscriptionCardHeader/queries/getPriceListChangeOptions.d.ts +9 -0
  32. package/dist/cjs/types/src/components/Subscriptions/subscriptionsList/utils/filterSubscriptionCharges.d.ts +2 -0
  33. package/dist/cjs/types/src/components/Subscriptions/subscriptionsList/utils/sortSubscriptionCharges.d.ts +2 -0
  34. package/dist/cjs/types/src/graphql/queries/getPriceListChangeOptions.d.ts +3 -4
  35. package/dist/cjs/types/src/hooks/useAllErrorFormats.d.ts +1 -0
  36. package/dist/cjs/types/src/hooks/useCreateQueryClient.d.ts +2 -0
  37. package/dist/cjs/types/src/types/SubscriptionCharge.d.ts +39 -0
  38. package/dist/cjs/types/src/utils/QueryKeyFactory.d.ts +91 -0
  39. package/dist/cjs/types/src/utils/chargeUtils.d.ts +5 -2
  40. package/dist/cjs/types/src/utils/createStateContext.d.ts +11 -0
  41. package/dist/cjs/types/src/utils/pricePickerUtils.d.ts +1 -1
  42. package/dist/esm/index.js +2564 -2234
  43. package/dist/esm/types/src/components/BunnyProvider.d.ts +0 -2
  44. package/dist/esm/types/src/components/Checkout/Checkout.d.ts +1 -1
  45. package/dist/esm/types/src/components/Checkout/QuoteCheckout.d.ts +4 -4
  46. package/dist/esm/types/src/components/QuoteProvider/fragments/quoteFieldsFragment.d.ts +65 -0
  47. package/dist/esm/types/src/components/QuoteProvider/fragments/quoteFragment.d.ts +16 -112
  48. package/dist/esm/types/src/components/QuoteProvider/hooks/useFeatureQuantities.d.ts +12 -0
  49. package/dist/esm/types/src/components/QuoteProvider/hooks/useQuoteQuantities.d.ts +0 -5
  50. package/dist/esm/types/src/components/QuoteProvider/mutations/quoteChangeUpdate.d.ts +16 -0
  51. package/dist/esm/types/src/components/QuoteProvider/utils/getQuantityFromQuoteChange.d.ts +11 -0
  52. package/dist/esm/types/src/components/QuoteProvider/utils/quoteChangeCanBeEdited.d.ts +4 -0
  53. package/dist/esm/types/src/components/Subscriptions/Subscriptions.d.ts +1 -5
  54. package/dist/esm/types/src/components/Subscriptions/SubscriptionsListContainer.d.ts +0 -4
  55. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/PlanPicker.d.ts +1 -2
  56. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/checkoutBar/PlanPickerCheckoutBar.d.ts +19 -0
  57. package/dist/esm/types/src/components/Subscriptions/Upgrade/PlanPicker/planPickerDesktop/planManagerUtils.d.ts +5 -2
  58. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/QuantityChangeGridRow.d.ts +1 -5
  59. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/QuantityDrawer.d.ts +1 -4
  60. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/QuoteChangeSummarySection.d.ts +11 -6
  61. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/context/quoteIdContext.d.ts +5 -0
  62. package/dist/{cjs/types/src/components/Subscriptions/quantityChangeDrawer/fragments/QuantityDrawerQuoteFragment.d.ts → esm/types/src/components/Subscriptions/quantityChangeDrawer/fragments/QuantityDrawer_QuoteFragment.d.ts} +4 -0
  63. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/hooks/useQuoteQueryData.d.ts +3 -3
  64. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/hooks/useSetQuoteQueryData.d.ts +2 -2
  65. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/quantityChangeDrawerDesktop/QuantityChangeDrawerDesktop.d.ts +1 -6
  66. package/dist/{cjs/types/src/components/Subscriptions/quantityChangeDrawer → esm/types/src/components/Subscriptions/quantityChangeDrawer/quantityInput}/QuantityInput.d.ts +2 -9
  67. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/quantityInput/fragments/QuantityInput_QuoteFragment.d.ts +27 -0
  68. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/utils/utils.d.ts +3 -2
  69. package/dist/esm/types/src/components/Subscriptions/subscriptionsList/SubscriptionChargeTotal.d.ts +3 -3
  70. package/dist/esm/types/src/components/Subscriptions/subscriptionsList/subscriptionCardHeader/components/SubscriptionCardActions.d.ts +21 -0
  71. package/dist/esm/types/src/components/Subscriptions/subscriptionsList/subscriptionCardHeader/queries/getPriceListChangeOptions.d.ts +9 -0
  72. package/dist/esm/types/src/components/Subscriptions/subscriptionsList/utils/filterSubscriptionCharges.d.ts +2 -0
  73. package/dist/esm/types/src/components/Subscriptions/subscriptionsList/utils/sortSubscriptionCharges.d.ts +2 -0
  74. package/dist/esm/types/src/graphql/queries/getPriceListChangeOptions.d.ts +3 -4
  75. package/dist/esm/types/src/hooks/useAllErrorFormats.d.ts +1 -0
  76. package/dist/esm/types/src/hooks/useCreateQueryClient.d.ts +2 -0
  77. package/dist/esm/types/src/types/SubscriptionCharge.d.ts +39 -0
  78. package/dist/esm/types/src/utils/QueryKeyFactory.d.ts +91 -0
  79. package/dist/esm/types/src/utils/chargeUtils.d.ts +5 -2
  80. package/dist/esm/types/src/utils/createStateContext.d.ts +11 -0
  81. package/dist/esm/types/src/utils/pricePickerUtils.d.ts +1 -1
  82. package/package.json +1 -1
  83. package/dist/cjs/types/src/components/QuoteProvider/mutations/quoteChargeUpdate.d.ts +0 -23
  84. package/dist/cjs/types/src/components/Subscriptions/subscriptionsList/SubscriptionCardActions.d.ts +0 -9
  85. package/dist/cjs/types/src/graphql/queries/getFeatureUsage.d.ts +0 -7
  86. package/dist/cjs/types/src/hooks/usePriceListChangeOptions.d.ts +0 -9
  87. package/dist/cjs/types/src/utils/GraphQLClient.d.ts +0 -2
  88. package/dist/esm/types/src/components/QuoteProvider/mutations/quoteChargeUpdate.d.ts +0 -23
  89. package/dist/esm/types/src/components/Subscriptions/subscriptionsList/SubscriptionCardActions.d.ts +0 -9
  90. package/dist/esm/types/src/graphql/queries/getFeatureUsage.d.ts +0 -7
  91. package/dist/esm/types/src/hooks/usePriceListChangeOptions.d.ts +0 -9
  92. package/dist/esm/types/src/utils/GraphQLClient.d.ts +0 -2
  93. /package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/{queries → mutations}/quoteChargeCreate.d.ts +0 -0
  94. /package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/{queries → mutations}/quoteChargeUpdate.d.ts +0 -0
  95. /package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/{queries → mutations}/quoteSubscriptionUpdate.d.ts +0 -0
  96. /package/dist/cjs/types/src/components/Subscriptions/subscriptionsList/{SubscriptionCardHeader.d.ts → subscriptionCardHeader/SubscriptionCardHeader.d.ts} +0 -0
  97. /package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/{queries → mutations}/quoteChargeCreate.d.ts +0 -0
  98. /package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/{queries → mutations}/quoteChargeUpdate.d.ts +0 -0
  99. /package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/{queries → mutations}/quoteSubscriptionUpdate.d.ts +0 -0
  100. /package/dist/esm/types/src/components/Subscriptions/subscriptionsList/{SubscriptionCardHeader.d.ts → subscriptionCardHeader/SubscriptionCardHeader.d.ts} +0 -0
@@ -1,9 +1,7 @@
1
1
  import { QueryClient } from '@tanstack/react-query';
2
2
  import { ThemeConfig } from 'antd';
3
- import { GraphQLClient } from 'graphql-request';
4
3
  export type BunnyContextValues = {
5
4
  apiHost: string;
6
- graphQLClient: GraphQLClient;
7
5
  token?: string;
8
6
  darkMode?: boolean;
9
7
  onTokenExpired?: () => void;
@@ -20,7 +20,7 @@ type CheckoutProps = {
20
20
  onFail: (error: any) => void;
21
21
  onSuccess: () => void;
22
22
  open: boolean;
23
- quote?: FragmentOf<typeof Checkout_QuoteFragment>;
23
+ quote?: FragmentOf<typeof Checkout_QuoteFragment> | null;
24
24
  token?: string;
25
25
  isUpdatingQuote: boolean;
26
26
  };
@@ -9,7 +9,7 @@ export declare const QuoteCheckout_QuoteFragment: import("gql.tada").TadaDocumen
9
9
  quoteChanges: ({
10
10
  id: string | null;
11
11
  charges: {
12
- kind: "COUPON" | "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | "ACTIVATE" | null;
12
+ kind: "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "COUPON" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | "ACTIVATE" | null;
13
13
  coupon: {
14
14
  couponCode: string;
15
15
  } | null;
@@ -17,7 +17,7 @@ export declare const QuoteCheckout_QuoteFragment: import("gql.tada").TadaDocumen
17
17
  }[] & {
18
18
  currencyId: string;
19
19
  id: string | null;
20
- kind: "COUPON" | "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | "ACTIVATE";
20
+ kind: "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "COUPON" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | "ACTIVATE";
21
21
  charges: {
22
22
  subtotal: number | null;
23
23
  amountsByPeriod: {
@@ -42,7 +42,7 @@ export declare const QuoteCheckout_QuoteFragment: import("gql.tada").TadaDocumen
42
42
  couponCode: string;
43
43
  } | null;
44
44
  quantity: number | null;
45
- kind: "COUPON" | "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | "ACTIVATE" | null;
45
+ kind: "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "COUPON" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | "ACTIVATE" | null;
46
46
  }[];
47
47
  priceList: {
48
48
  id: string;
@@ -68,7 +68,7 @@ export declare const QuoteCheckout_QuoteFragment: import("gql.tada").TadaDocumen
68
68
  amount: number | null;
69
69
  startDate: unknown;
70
70
  }[];
71
- kind: "COUPON" | "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | "ACTIVATE";
71
+ kind: "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "COUPON" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | "ACTIVATE";
72
72
  }, {}, {
73
73
  fragment: "QuoteCheckout_QuoteFragment";
74
74
  on: "Quote";
@@ -0,0 +1,65 @@
1
+ export declare const QuoteFields_QuoteFragment: import("gql.tada").TadaDocumentNode<{
2
+ accountId: string;
3
+ amount: number;
4
+ amountDue: number | null;
5
+ smallUnitAmountDue: number | null;
6
+ currencyId: string;
7
+ id: string | null;
8
+ payableId: string | null;
9
+ periodAmount: number | null;
10
+ subtotal: number;
11
+ taxAmount: number;
12
+ startDate: unknown;
13
+ formattedQuote: {
14
+ html: string | null;
15
+ } | null;
16
+ amountsByPeriod: {
17
+ amount: number | null;
18
+ startDate: unknown;
19
+ }[];
20
+ kind: "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "COUPON" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | "ACTIVATE";
21
+ quoteChanges: {
22
+ currencyId: string;
23
+ id: string | null;
24
+ kind: "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "COUPON" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | "ACTIVATE";
25
+ charges: {
26
+ subtotal: number | null;
27
+ amountsByPeriod: {
28
+ amount: number | null;
29
+ startDate: unknown;
30
+ }[] | null;
31
+ amount: number | null;
32
+ billingPeriod: "ONCE" | "MONTHLY" | "QUARTERLY" | "SEMI_ANNUAL" | "ANNUAL" | null;
33
+ currencyId: string;
34
+ feature: {
35
+ unitName: string | null;
36
+ } | null;
37
+ id: string | null;
38
+ name: string | null;
39
+ priceListCharge: {
40
+ id: string;
41
+ } | null;
42
+ priceList: {
43
+ id: string;
44
+ } | null;
45
+ coupon: {
46
+ couponCode: string;
47
+ } | null;
48
+ quantity: number | null;
49
+ kind: "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "COUPON" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | "ACTIVATE" | null;
50
+ }[];
51
+ priceList: {
52
+ id: string;
53
+ plan: {
54
+ name: string;
55
+ } | null;
56
+ product: {
57
+ name: string;
58
+ } | null;
59
+ } | null;
60
+ }[] | null;
61
+ }, {}, {
62
+ fragment: "QuoteFields_QuoteFragment";
63
+ on: "Quote";
64
+ masked: false;
65
+ }>;
@@ -1,68 +1,3 @@
1
- export declare const QuoteFields_QuoteFragment: import("gql.tada").TadaDocumentNode<{
2
- accountId: string;
3
- amount: number;
4
- amountDue: number | null;
5
- smallUnitAmountDue: number | null;
6
- currencyId: string;
7
- id: string | null;
8
- payableId: string | null;
9
- periodAmount: number | null;
10
- subtotal: number;
11
- taxAmount: number;
12
- startDate: unknown;
13
- formattedQuote: {
14
- html: string | null;
15
- } | null;
16
- amountsByPeriod: {
17
- amount: number | null;
18
- startDate: unknown;
19
- }[];
20
- kind: "COUPON" | "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | "ACTIVATE";
21
- quoteChanges: {
22
- currencyId: string;
23
- id: string | null;
24
- kind: "COUPON" | "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | "ACTIVATE";
25
- charges: {
26
- subtotal: number | null;
27
- amountsByPeriod: {
28
- amount: number | null;
29
- startDate: unknown;
30
- }[] | null;
31
- amount: number | null;
32
- billingPeriod: "ONCE" | "MONTHLY" | "QUARTERLY" | "SEMI_ANNUAL" | "ANNUAL" | null;
33
- currencyId: string;
34
- feature: {
35
- unitName: string | null;
36
- } | null;
37
- id: string | null;
38
- name: string | null;
39
- priceListCharge: {
40
- id: string;
41
- } | null;
42
- priceList: {
43
- id: string;
44
- } | null;
45
- coupon: {
46
- couponCode: string;
47
- } | null;
48
- quantity: number | null;
49
- kind: "COUPON" | "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | "ACTIVATE" | null;
50
- }[];
51
- priceList: {
52
- id: string;
53
- plan: {
54
- name: string;
55
- } | null;
56
- product: {
57
- name: string;
58
- } | null;
59
- } | null;
60
- }[] | null;
61
- }, {}, {
62
- fragment: "QuoteFields_QuoteFragment";
63
- on: "Quote";
64
- masked: false;
65
- }>;
66
1
  /**
67
2
  * Central quote fragment for QuoteProvider context.
68
3
  *
@@ -76,65 +11,34 @@ export declare const QuoteFields_QuoteFragment: import("gql.tada").TadaDocumentN
76
11
  * - Type safety ensures all required fields are fetched
77
12
  */
78
13
  export declare const QuoteContext_QuoteFragment: import("gql.tada").TadaDocumentNode<{
79
- accountId: string;
80
- amount: number;
81
- amountDue: number | null;
82
- smallUnitAmountDue: number | null;
83
- currencyId: string;
84
14
  id: string | null;
85
- payableId: string | null;
86
- periodAmount: number | null;
87
- subtotal: number;
88
- taxAmount: number;
89
- startDate: unknown;
90
- formattedQuote: {
91
- html: string | null;
92
- } | null;
93
- amountsByPeriod: {
94
- amount: number | null;
95
- startDate: unknown;
96
- }[];
97
- kind: "COUPON" | "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | "ACTIVATE";
15
+ currencyId: string;
16
+ amountDue: number | null;
98
17
  quoteChanges: {
99
- currencyId: string;
100
18
  id: string | null;
101
- kind: "COUPON" | "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | "ACTIVATE";
19
+ kind: "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "COUPON" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | "ACTIVATE";
20
+ priceList: {
21
+ id: string;
22
+ } | null;
102
23
  charges: {
103
- subtotal: number | null;
104
- amountsByPeriod: {
105
- amount: number | null;
106
- startDate: unknown;
107
- }[] | null;
108
- amount: number | null;
109
- billingPeriod: "ONCE" | "MONTHLY" | "QUARTERLY" | "SEMI_ANNUAL" | "ANNUAL" | null;
110
- currencyId: string;
111
- feature: {
112
- unitName: string | null;
113
- } | null;
114
- id: string | null;
115
- name: string | null;
116
24
  priceListCharge: {
117
25
  id: string;
26
+ chargeType: "ONE_TIME" | "RECURRING" | "USAGE" | null;
27
+ pricingModel: "FLAT" | "TIERED" | "VOLUME" | "BANDS" | null;
28
+ quantityMin: number | null;
29
+ quantityMax: number | null;
30
+ selfServiceQuantity: boolean | null;
118
31
  } | null;
119
- priceList: {
32
+ feature: {
120
33
  id: string;
121
34
  } | null;
122
- coupon: {
123
- couponCode: string;
124
- } | null;
125
35
  quantity: number | null;
126
- kind: "COUPON" | "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | "ACTIVATE" | null;
36
+ id: string | null;
127
37
  }[];
128
- priceList: {
129
- id: string;
130
- plan: {
131
- name: string;
132
- } | null;
133
- product: {
134
- name: string;
135
- } | null;
136
- } | null;
137
38
  }[] | null;
39
+ [$tada.fragmentRefs]: {
40
+ PlanPickerCheckoutBar_QuoteFragment: "Quote";
41
+ };
138
42
  }, {}, {
139
43
  fragment: "QuoteContext_QuoteFragment";
140
44
  on: "Quote";
@@ -0,0 +1,12 @@
1
+ export type FeatureQuantitiesDict = Record<string, number | undefined>;
2
+ /**
3
+ * Hook to manage feature quantities using a dictionary keyed by feature ID
4
+ * This tracks quantities for each unique feature.
5
+ */
6
+ export declare function useFeatureQuantities({ onFeatureQuantitiesChanged, }: {
7
+ onFeatureQuantitiesChanged?: (featureQuantities: FeatureQuantitiesDict) => void;
8
+ }): {
9
+ featureQuantities: FeatureQuantitiesDict;
10
+ getFeatureQuantity: (featureId: string, featureQuantities: FeatureQuantitiesDict) => number | undefined;
11
+ onUpdateFeatureQuantity: (featureId: string, quantity: number) => void;
12
+ };
@@ -9,8 +9,3 @@ export declare const useQuoteQuantities: ({ selectedPriceList, quote, }: {
9
9
  getFeatureQuantity: (featureId: string) => number | undefined;
10
10
  isUpdatingCharges: boolean;
11
11
  };
12
- /**
13
- * Hook to manage feature quantities using a dictionary keyed by feature ID
14
- * This tracks quantities for each unique feature.
15
- */
16
- export type FeatureQuantitiesDict = Record<string, number | undefined>;
@@ -0,0 +1,16 @@
1
+ declare const quoteChangeUpdate: ({ quoteChangeId, charges, apiHost, token, }: {
2
+ quoteChangeId: string;
3
+ charges: {
4
+ id: string;
5
+ quantity: number;
6
+ }[];
7
+ apiHost: string;
8
+ token: string;
9
+ }) => Promise<{
10
+ quote: {
11
+ [$tada.fragmentRefs]: {
12
+ QuoteContext_QuoteFragment: "Quote";
13
+ };
14
+ };
15
+ } | null | undefined>;
16
+ export default quoteChangeUpdate;
@@ -0,0 +1,11 @@
1
+ export declare function getQuantityFromQuoteChange(quoteChange: {
2
+ priceList: {
3
+ id: string;
4
+ } | null;
5
+ charges: {
6
+ feature: {
7
+ id: string;
8
+ } | null;
9
+ quantity: number | null;
10
+ }[];
11
+ } | null, featureId: string): number | null | undefined;
@@ -0,0 +1,4 @@
1
+ import { QuoteChangeKind } from '@/graphql-codegen/exportedScalarTypes';
2
+ export declare function isQuoteChangeEditable(quoteChange: {
3
+ kind: QuoteChangeKind;
4
+ }): boolean;
@@ -1,14 +1,10 @@
1
1
  export declare const Subscriptions_SubscriptionFragment: import("gql.tada").TadaDocumentNode<{
2
- state: "ACTIVE" | "TRIAL" | "CANCELED" | "EXPIRED" | "TRIAL_EXPIRED" | "PENDING";
2
+ state: "ACTIVE" | "TRIAL" | "PENDING" | "EXPIRED" | "CANCELED" | "TRIAL_EXPIRED";
3
3
  }, {}, {
4
4
  fragment: "Subscriptions_SubscriptionFragment";
5
5
  on: "Subscription";
6
6
  masked: true;
7
7
  }>;
8
- export type EditingQuoteDataType = {
9
- id: string;
10
- isTrial: boolean;
11
- };
12
8
  declare const SubscriptionsWrapper: ({ handlePortalErrors, companyName, isInPreviewMode, productId, className, styles: userStyles, noSubscriptionsComponent, showInactiveSubscriptions, showInactiveSubscriptionsToggle, }: {
13
9
  handlePortalErrors?: (errors: any) => void;
14
10
  companyName: string;
@@ -1,9 +1,5 @@
1
1
  import { Subscription } from '@bunnyapp/common';
2
2
  import '../../styles/index.less';
3
- export type EditingQuoteDataType = {
4
- id: string;
5
- isTrial: boolean;
6
- };
7
3
  declare const SubscriptionsListContainer: ({ companyName, showInactive, onCancelSubscriptionClick, onChangePlanClick, noSubscriptionsComponent, subscriptions, subscriptionsAreLoading, }: {
8
4
  companyName: string;
9
5
  showInactive?: boolean;
@@ -1,6 +1,5 @@
1
1
  import { Subscription } from '@bunnyapp/common';
2
- declare const PlanPicker: ({ upgradingSubscription, onGoBack, areSubscriptionsLoading, subscriptions, }: {
3
- upgradingSubscription?: Subscription;
2
+ declare const PlanPicker: ({ onGoBack, areSubscriptionsLoading, subscriptions, }: {
4
3
  onGoBack?: () => void;
5
4
  areSubscriptionsLoading: boolean;
6
5
  subscriptions: Subscription[];
@@ -1,4 +1,23 @@
1
1
  import { PriceList } from '@bunnyapp/common';
2
+ export declare const PlanPickerCheckoutBar_QuoteFragment: import("gql.tada").TadaDocumentNode<{
3
+ [$tada.fragmentRefs]: {
4
+ Checkout_QuoteFragment: "Quote";
5
+ };
6
+ quoteChanges: {
7
+ priceList: {
8
+ id: string;
9
+ } | null;
10
+ charges: {
11
+ priceListCharge: {
12
+ id: string;
13
+ } | null;
14
+ }[];
15
+ }[] | null;
16
+ }, {}, {
17
+ fragment: "PlanPickerCheckoutBar_QuoteFragment";
18
+ on: "Quote";
19
+ masked: true;
20
+ }>;
2
21
  declare const PlanPickerCheckoutBar: ({ selectedPriceList, handlePortalErrors, onCheckoutSuccess, }: {
3
22
  selectedPriceList: PriceList;
4
23
  handlePortalErrors?: (errors: any) => void;
@@ -1,2 +1,5 @@
1
- import { PriceListCharge } from '@bunnyapp/common';
2
- export declare const calculateNewQuantity: (priceListCharge: PriceListCharge, currentQuantity?: number) => number;
1
+ export declare const calculateNewQuantity: (priceListCharge: {
2
+ quantityMax: number | null;
3
+ quantityMin: number | null;
4
+ selfServiceQuantity: boolean | null;
5
+ }, currentQuantity?: number) => number;
@@ -1,4 +1,3 @@
1
- import { Quote } from '@bunnyapp/common';
2
1
  import { FragmentOf } from 'gql.tada';
3
2
  export declare const QuantityChangeGridRow_SubscriptionChargeFragment: import("gql.tada").TadaDocumentNode<{
4
3
  id: string | null;
@@ -39,10 +38,7 @@ export declare const QuantityChangeGridRow_SubscriptionFragment: import("gql.tad
39
38
  on: "Subscription";
40
39
  masked: true;
41
40
  }>;
42
- declare const QuantityChangeGridRow: ({ editingQuote, editingQuoteId, setEditingQuoteData, subscription: maskedSubscription, subscriptionCharge: maskedSubscriptionCharge, setUpdatingChargeQuantityId, updatingChargeQuantityId, setErrorUpdatingQuantity, }: {
43
- editingQuote?: Quote;
44
- editingQuoteId?: string;
45
- setEditingQuoteData: (value: any) => void;
41
+ declare const QuantityChangeGridRow: ({ subscription: maskedSubscription, subscriptionCharge: maskedSubscriptionCharge, setUpdatingChargeQuantityId, updatingChargeQuantityId, setErrorUpdatingQuantity, }: {
46
42
  subscription: FragmentOf<typeof QuantityChangeGridRow_SubscriptionFragment>;
47
43
  subscriptionCharge: FragmentOf<typeof QuantityChangeGridRow_SubscriptionChargeFragment>;
48
44
  setUpdatingChargeQuantityId: (updatingChargeQuantityId: string | undefined) => void;
@@ -1,9 +1,5 @@
1
1
  import { FragmentOf } from 'gql.tada';
2
2
  import { QuantityDrawerDesktop_SubscriptionFragment } from './quantityChangeDrawerDesktop/QuantityChangeDrawerDesktop';
3
- export type EditingQuoteDataType = {
4
- id: string;
5
- isTrial: boolean;
6
- };
7
3
  interface QuantityDrawerProps {
8
4
  subscriptions: (FragmentOf<typeof QuantityDrawerDesktop_SubscriptionFragment> | null)[];
9
5
  quantityDrawerOpen: boolean;
@@ -11,5 +7,6 @@ interface QuantityDrawerProps {
11
7
  handlePortalErrors?: (errors: any) => void;
12
8
  setShowInactive: (showInactive: boolean) => void;
13
9
  }
10
+ export declare const QuantityDrawerContent: ({ subscriptions, quantityDrawerOpen, setQuantityDrawerOpen, handlePortalErrors, setShowInactive, }: QuantityDrawerProps) => import("react/jsx-runtime").JSX.Element;
14
11
  export declare const QuantityDrawer: ({ subscriptions, quantityDrawerOpen, setQuantityDrawerOpen, handlePortalErrors, setShowInactive, }: QuantityDrawerProps) => import("react/jsx-runtime").JSX.Element;
15
12
  export {};
@@ -1,10 +1,15 @@
1
- import { Quote } from '@bunnyapp/common';
2
- import { EditingQuoteDataType } from '../SubscriptionsListContainer';
3
- declare const QuoteChangeSummarySection: ({ editingQuote, editingQuoteData, openCheckout, setEditingQuoteData, errorUpdatingQuantity, }: {
4
- editingQuote?: Quote;
5
- editingQuoteData?: EditingQuoteDataType;
1
+ export declare const QuoteChangeSummarySection_QuoteFragment: import("gql.tada").TadaDocumentNode<{
2
+ id: string | null;
3
+ amountDue: number | null;
4
+ amount: number;
5
+ currencyId: string;
6
+ }, {}, {
7
+ fragment: "QuoteChangeSummarySection_QuoteFragment";
8
+ on: "Quote";
9
+ masked: true;
10
+ }>;
11
+ declare const QuoteChangeSummarySection: ({ openCheckout, errorUpdatingQuantity, }: {
6
12
  openCheckout: () => void;
7
- setEditingQuoteData: (editingQuoteData: EditingQuoteDataType | undefined) => void;
8
13
  errorUpdatingQuantity: boolean;
9
14
  }) => import("react/jsx-runtime").JSX.Element;
10
15
  export default QuoteChangeSummarySection;
@@ -0,0 +1,5 @@
1
+ declare const QuoteIdProvider: ({ initialValue, children, }: {
2
+ initialValue?: string | undefined;
3
+ children?: import("react").ReactNode;
4
+ }) => import("react/jsx-runtime").JSX.Element, useQuoteId: () => [string | undefined, import("react").Dispatch<import("react").SetStateAction<string | undefined>>];
5
+ export { QuoteIdProvider, useQuoteId };
@@ -2,6 +2,10 @@ export declare const QuantityDrawer_QuoteFragment: import("gql.tada").TadaDocume
2
2
  id: string | null;
3
3
  [$tada.fragmentRefs]: {
4
4
  Checkout_QuoteFragment: "Quote";
5
+ } & {
6
+ QuantityInput_QuoteFragment: "Quote";
7
+ } & {
8
+ QuoteChangeSummarySection_QuoteFragment: "Quote";
5
9
  };
6
10
  }, {}, {
7
11
  fragment: "QuantityDrawer_QuoteFragment";
@@ -1,3 +1,3 @@
1
- import { FragmentOf } from 'gql.tada';
2
- import { QuantityDrawer_QuoteFragment } from '../fragments/QuantityDrawerQuoteFragment';
3
- export declare const useQuoteQueryData: (quoteId: string | undefined) => FragmentOf<typeof QuantityDrawer_QuoteFragment> | undefined;
1
+ import { ResultOf } from 'gql.tada';
2
+ import { QuantityDrawer_QuoteFragment } from '../fragments/QuantityDrawer_QuoteFragment';
3
+ export declare const useQuoteQueryData: (quoteId: string | undefined) => ResultOf<typeof QuantityDrawer_QuoteFragment> | undefined;
@@ -1,5 +1,5 @@
1
1
  import { FragmentOf } from 'gql.tada';
2
- import { QuantityDrawer_QuoteFragment } from '../fragments/QuantityDrawerQuoteFragment';
2
+ import { QuantityDrawer_QuoteFragment } from '../fragments/QuantityDrawer_QuoteFragment';
3
3
  export declare const useSetQuoteQueryData: () => {
4
- setQuoteQueryData: (quoteId: string, maskedQuote: FragmentOf<typeof QuantityDrawer_QuoteFragment> | null) => void;
4
+ setQuoteQueryData: (quoteId: string, quote: FragmentOf<typeof QuantityDrawer_QuoteFragment> | null) => void;
5
5
  };
@@ -1,6 +1,4 @@
1
- import { Quote } from '@bunnyapp/common';
2
1
  import { FragmentOf } from 'gql.tada';
3
- import { EditingQuoteDataType } from '../../SubscriptionsListContainer';
4
2
  export declare const QuantityDrawerDesktop_SubscriptionFragment: import("gql.tada").TadaDocumentNode<{
5
3
  currentCharges: {
6
4
  chargeType: "ONE_TIME" | "RECURRING" | "USAGE" | null;
@@ -16,13 +14,10 @@ export declare const QuantityDrawerDesktop_SubscriptionFragment: import("gql.tad
16
14
  on: "Subscription";
17
15
  masked: true;
18
16
  }>;
19
- declare const QuantityChangeDrawerDesktop: ({ editingQuote, editingQuoteData, onClose, open, openCheckout, setEditingQuoteData, subscriptions, setUpdatingChargeQuantityId, updatingChargeQuantityId, }: {
20
- editingQuote?: Quote;
21
- editingQuoteData?: EditingQuoteDataType;
17
+ declare const QuantityChangeDrawerDesktop: ({ onClose, open, openCheckout, subscriptions, setUpdatingChargeQuantityId, updatingChargeQuantityId, }: {
22
18
  onClose: () => void;
23
19
  open: boolean;
24
20
  openCheckout: () => void;
25
- setEditingQuoteData: (value: EditingQuoteDataType | undefined) => void;
26
21
  subscriptions: (FragmentOf<typeof QuantityDrawerDesktop_SubscriptionFragment> | null)[];
27
22
  setUpdatingChargeQuantityId: (updatingChargeQuantityId: string | undefined) => void;
28
23
  updatingChargeQuantityId: string | undefined;
@@ -1,4 +1,3 @@
1
- import { Quote } from '@bunnyapp/common';
2
1
  import { FragmentOf } from 'gql.tada';
3
2
  export declare const QuantityInput_SubscriptionChargeFragment: import("gql.tada").TadaDocumentNode<{
4
3
  id: string | null;
@@ -12,7 +11,7 @@ export declare const QuantityInput_SubscriptionChargeFragment: import("gql.tada"
12
11
  }>;
13
12
  export declare const QuantityInput_SubscriptionFragment: import("gql.tada").TadaDocumentNode<{
14
13
  id: string;
15
- state: "ACTIVE" | "TRIAL" | "CANCELED" | "EXPIRED" | "TRIAL_EXPIRED" | "PENDING";
14
+ state: "ACTIVE" | "TRIAL" | "PENDING" | "EXPIRED" | "CANCELED" | "TRIAL_EXPIRED";
16
15
  priceList: {
17
16
  id: string;
18
17
  } | null;
@@ -31,14 +30,8 @@ export declare const QuantityInput_SubscriptionFragment: import("gql.tada").Tada
31
30
  on: "Subscription";
32
31
  masked: true;
33
32
  }>;
34
- declare const QuantityInput: ({ charge: maskedCharge, editingQuote, editingQuoteId, setEditingQuoteData, subscription: maskedSubscription, setUpdatingChargeQuantityId, updatingChargeQuantityId, setErrorUpdatingQuantity, }: {
33
+ declare const QuantityInput: ({ charge: maskedCharge, subscription: maskedSubscription, setUpdatingChargeQuantityId, updatingChargeQuantityId, setErrorUpdatingQuantity, }: {
35
34
  charge: FragmentOf<typeof QuantityInput_SubscriptionChargeFragment>;
36
- editingQuote?: Quote;
37
- editingQuoteId?: string;
38
- setEditingQuoteData: (editingQuoteData: {
39
- id: string;
40
- isTrial: boolean;
41
- } | undefined) => void;
42
35
  subscription: FragmentOf<typeof QuantityInput_SubscriptionFragment>;
43
36
  setUpdatingChargeQuantityId: (updatingChargeQuantityId: string | undefined) => void;
44
37
  updatingChargeQuantityId: string | undefined;
@@ -0,0 +1,27 @@
1
+ export declare const QuantityInput_QuoteFragment: import("gql.tada").TadaDocumentNode<{
2
+ id: string | null;
3
+ quoteChanges: {
4
+ id: string | null;
5
+ priceList: {
6
+ id: string;
7
+ } | null;
8
+ charges: {
9
+ id: string | null;
10
+ priceListCharge: {
11
+ id: string;
12
+ } | null;
13
+ }[];
14
+ subscription: {
15
+ charges: {
16
+ id: string | null;
17
+ priceListCharge: {
18
+ id: string;
19
+ } | null;
20
+ }[] | null;
21
+ } | null;
22
+ }[] | null;
23
+ }, {}, {
24
+ fragment: "QuantityInput_QuoteFragment";
25
+ on: "Quote";
26
+ masked: true;
27
+ }>;
@@ -4,6 +4,7 @@ export declare const CanShowQuantitiesInput_SubscriptionChargeFragment: import("
4
4
  pricingModel: "FLAT" | "TIERED" | "VOLUME" | "BANDS" | null;
5
5
  expired: boolean;
6
6
  selfServiceQuantity: boolean | null;
7
+ kind: "SUBSCRIBE" | "UPDATE" | "RENEW" | "REINSTATE" | "UNSUBSCRIBE" | "ADJUSTMENT" | "COUPON" | "DISCOUNT" | "CREDIT" | "PRICE_UPDATE" | "QUANTITY_UPDATE" | "FREE_PERIOD_DISCOUNT" | "ACTIVATE" | null;
7
8
  }, {}, {
8
9
  fragment: "CanShowQuantitiesInput_SubscriptionChargeFragment";
9
10
  on: "SubscriptionCharge";
@@ -11,11 +12,11 @@ export declare const CanShowQuantitiesInput_SubscriptionChargeFragment: import("
11
12
  }>;
12
13
  export declare const CanShowQuantitiesInput_SubscriptionFragment: import("gql.tada").TadaDocumentNode<{
13
14
  id: string;
14
- state: "ACTIVE" | "TRIAL" | "CANCELED" | "EXPIRED" | "TRIAL_EXPIRED" | "PENDING";
15
+ state: "ACTIVE" | "TRIAL" | "PENDING" | "EXPIRED" | "CANCELED" | "TRIAL_EXPIRED";
15
16
  priceList: {
16
17
  id: string;
17
18
  } | null;
18
- chargeReport: {
19
+ currentCharges: {
19
20
  [$tada.fragmentRefs]: {
20
21
  CanShowQuantitiesInput_SubscriptionChargeFragment: "SubscriptionCharge";
21
22
  };
@@ -1,6 +1,6 @@
1
- import { Subscription, SubscriptionCharge } from '@bunnyapp/common';
2
- declare const SubscriptionChargeTotal: ({ charge, subscription, }: {
1
+ import { SubscriptionCharge } from '@bunnyapp/common';
2
+ declare const SubscriptionChargeTotal: ({ charge, currencyId, }: {
3
3
  charge: SubscriptionCharge;
4
- subscription: Subscription;
4
+ currencyId: string;
5
5
  }) => import("react/jsx-runtime").JSX.Element;
6
6
  export default SubscriptionChargeTotal;
@@ -0,0 +1,21 @@
1
+ import { Subscription } from '@bunnyapp/common';
2
+ import { FragmentOf } from 'gql.tada';
3
+ export declare const SubscriptionCardActions_PriceListChangeOptionsFragment: import("gql.tada").TadaDocumentNode<{
4
+ priceLists: {
5
+ id: string;
6
+ product: {
7
+ id: string;
8
+ } | null;
9
+ }[] | null;
10
+ }, {}, {
11
+ fragment: "SubscriptionCardActions_PriceListChangeOptionsFragment";
12
+ on: "PriceListChangeOptions";
13
+ masked: true;
14
+ }>;
15
+ export declare const SubscriptionCardActions: ({ onChangePlanClick, onCancelSubscriptionClick, priceListChangeOptions: maskedPriceListChangeOptions, subscription, isPaymentMethodLoading, }: {
16
+ onChangePlanClick?: (subscription: Subscription) => void;
17
+ onCancelSubscriptionClick?: (subscription: Subscription) => void;
18
+ priceListChangeOptions?: FragmentOf<typeof SubscriptionCardActions_PriceListChangeOptionsFragment>;
19
+ subscription: Subscription;
20
+ isPaymentMethodLoading: boolean;
21
+ }) => import("react/jsx-runtime").JSX.Element | null;