@bunnyapp/components 1.0.76-beta.6 → 1.0.76-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -154,7 +154,7 @@ var BrandContext = react.createContext({
154
154
  });
155
155
 
156
156
  // This will be replaced at build time by rollup-plugin-replace
157
- var PACKAGE_VERSION = '1.0.76-beta.6';
157
+ var PACKAGE_VERSION = '1.0.76-beta.8';
158
158
  var createRequestHeaders = function (token) {
159
159
  var headers = common.createClientDevHeaders(token);
160
160
  // Add the components version header
@@ -22687,7 +22687,7 @@ var hasMultiplePriceTiers = function (charge) {
22687
22687
  var _a;
22688
22688
  return ((_a = charge === null || charge === void 0 ? void 0 : charge.priceTiers) === null || _a === void 0 ? void 0 : _a.length) > 1;
22689
22689
  };
22690
- var getApplicablePriceTier = function (charge, currencyId) {
22690
+ var getApplicablePriceTier = function (charge, currencyId, priceDecimals) {
22691
22691
  var _a;
22692
22692
  if (!((_a = charge.priceTiers) === null || _a === void 0 ? void 0 : _a.length))
22693
22693
  return '';
@@ -22721,8 +22721,8 @@ var getApplicablePriceTier = function (charge, currencyId) {
22721
22721
  var nextTier = charge.priceTiers[tierIndex + 1];
22722
22722
  var ends = nextTier ? nextTier.starts - 1 : '∞';
22723
22723
  return hasMultiplePriceTiers(charge)
22724
- ? "".concat(starts, "-").concat(ends, ": ").concat(common.formatCurrency(selectedTier.price, currencyId))
22725
- : "".concat(common.formatCurrency(selectedTier.price, currencyId));
22724
+ ? "".concat(starts, "-").concat(ends, ": ").concat(common.formatCurrency(selectedTier.price, currencyId, priceDecimals))
22725
+ : "".concat(common.formatCurrency(selectedTier.price, currencyId, priceDecimals));
22726
22726
  };
22727
22727
 
22728
22728
  var SubscriptionCardActions = function (_a) {
@@ -22840,7 +22840,7 @@ var SubscriptionChargeUnitPrice = function (_a) {
22840
22840
  ? '-'
22841
22841
  : common.formatCurrency(charge.discountedPrice, currencyId, charge.priceDecimals);
22842
22842
  var isChargeDiscount = isDiscount(charge.kind);
22843
- return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: hasPriceTiers(charge) ? (jsxRuntime.jsx(TieredDisplayDropdown, { charge: charge, currencyId: currencyId, truncatedText: "".concat(charge.kind === common.QuoteChangeKind.PRICE_UPDATE ? 'new ' : '').concat(getApplicablePriceTier(charge, currencyId)) })) : isChargeDiscount ? ("-".concat(price)) : (price) }));
22843
+ return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: hasPriceTiers(charge) ? (jsxRuntime.jsx(TieredDisplayDropdown, { charge: charge, currencyId: currencyId, truncatedText: "".concat(charge.kind === common.QuoteChangeKind.PRICE_UPDATE ? 'new ' : '').concat(getApplicablePriceTier(charge, currencyId, charge.priceDecimals)) })) : isChargeDiscount ? ("-".concat(price)) : (price) }));
22844
22844
  };
22845
22845
 
22846
22846
  var Text$6 = antd.Typography.Text;
@@ -23057,17 +23057,17 @@ var QuantityInput = function (_a) {
23057
23057
  var createCharge = reactQuery.useMutation({
23058
23058
  mutationFn: quoteChargeCreate,
23059
23059
  onSuccess: function (response) {
23060
- var _a, _b, _c, _d, _e, _f, _g, _h;
23060
+ var _a, _b, _c, _d;
23061
23061
  if (!(editingQuote === null || editingQuote === void 0 ? void 0 : editingQuote.id)) {
23062
23062
  var isTrial = ((_b = (_a = editedSubscription === null || editedSubscription === void 0 ? void 0 : editedSubscription.subscription) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === common.SubscriptionState.TRIAL;
23063
23063
  setEditingQuoteData({
23064
- id: (_e = (_d = (_c = response.quoteChargeCreate) === null || _c === void 0 ? void 0 : _c.quoteCharge) === null || _d === void 0 ? void 0 : _d.quoteChange) === null || _e === void 0 ? void 0 : _e.quoteId,
23064
+ id: (_c = response.quoteChange) === null || _c === void 0 ? void 0 : _c.quoteId,
23065
23065
  isTrial: isTrial,
23066
23066
  });
23067
23067
  }
23068
23068
  queryClient.invalidateQueries({
23069
23069
  queryKey: common.QueryKeyFactory.default.createObjectKey({
23070
- id: (_h = (_g = (_f = response.quoteChargeCreate) === null || _f === void 0 ? void 0 : _f.quoteCharge) === null || _g === void 0 ? void 0 : _g.quoteChange) === null || _h === void 0 ? void 0 : _h.quoteId,
23070
+ id: (_d = response.quoteChange) === null || _d === void 0 ? void 0 : _d.quoteId,
23071
23071
  objectName: 'editingQuote',
23072
23072
  token: token,
23073
23073
  }),
@@ -23232,12 +23232,12 @@ var QuoteChangeSummarySection = function (_a) {
23232
23232
  mutationFn: function (quoteId) { return checkout({ quoteId: quoteId, token: token, apiHost: apiHost }); },
23233
23233
  onSuccess: function () {
23234
23234
  setEditingQuoteData(undefined);
23235
- showSuccessNotification("Subscription updated successfully");
23235
+ showSuccessNotification('Subscription updated successfully');
23236
23236
  },
23237
23237
  });
23238
- return (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-items-end" }, { children: [editingQuote && (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-mb-8" }, { children: [jsxRuntime.jsx("div", __assign({ className: "bunny-text-slate-500 bunny-text-right bunny-text-xs bunny-mb-2" }, { children: "TOTAL" })), jsxRuntime.jsx("div", __assign({ className: "bunny-text-right ".concat(isMobile ? "bunny-text-2xl" : "bunny-text-xl") }, { children: common.formatCurrency(getQuoteAmountDue(editingQuote), (editingQuote === null || editingQuote === void 0 ? void 0 : editingQuote.currencyId) || "") }))] }))), jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-items-center bunny-justify-end ".concat(isMobile ? "bunny-w-full" : "") }, { children: jsxRuntime.jsx(antd.Button, __assign({ className: "bunny-w-full", onClick: (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.isTrial)
23238
+ return (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-items-end" }, { children: [editingQuote && (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-mb-8" }, { children: [jsxRuntime.jsx("div", __assign({ className: "bunny-text-slate-500 bunny-text-right bunny-text-xs bunny-mb-2" }, { children: "TOTAL" })), jsxRuntime.jsx("div", __assign({ className: "bunny-text-right ".concat(isMobile ? 'bunny-text-2xl' : 'bunny-text-xl') }, { children: common.formatCurrency(getQuoteAmountDue(editingQuote), (editingQuote === null || editingQuote === void 0 ? void 0 : editingQuote.currencyId) || '') }))] }))), jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-items-center bunny-justify-end ".concat(isMobile ? 'bunny-w-full' : '') }, { children: jsxRuntime.jsx(antd.Button, __assign({ className: "bunny-w-full", onClick: (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.isTrial)
23239
23239
  ? function () { return trialUpgradeMutation.mutate(editingQuoteData.id); }
23240
- : openCheckout, disabled: !editingQuoteData, size: isMobile ? "large" : "middle", type: "primary" }, { children: (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.isTrial) ? "Activate Trial" : "Proceed to checkout" })) }))] })));
23240
+ : openCheckout, disabled: !editingQuoteData || !editingQuote, size: isMobile ? 'large' : 'middle', type: "primary" }, { children: (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.isTrial) ? 'Activate Trial' : 'Proceed to checkout' })) }))] })));
23241
23241
  };
23242
23242
 
23243
23243
  var QUANTITY_CHANGE_HEADER_TITLE = 'Update unit quantity';
@@ -43,16 +43,9 @@ export declare const filterUniqueFeatures: ({ availablePriceLists, }: {
43
43
  name: string;
44
44
  periodMonths: 0 | 1 | 3 | 6 | 12;
45
45
  planId: string;
46
- priceAdjustmentAction?: import("@bunnyapp/common").PriceAdjustmentAction | undefined;
47
- priceAdjustmentActionOptions?: string[] | undefined;
48
- priceAdjustmentPercentage?: number | undefined;
49
- priceAdjustmentTiming?: import("@bunnyapp/common").PriceAdjustmentTiming | undefined;
50
- priceAdjustmentTimingOptions?: string[] | undefined;
51
46
  priceDescription?: string | undefined;
52
47
  product: Product;
53
48
  productId?: string | undefined;
54
- renewalTermMonths?: number | undefined;
55
- showPriceAsMonthly?: boolean | undefined;
56
49
  sku?: string | undefined;
57
50
  trialAllowed: boolean;
58
51
  trialExpirationAction?: ("CANCEL" | "ACTIVATE") | undefined;
@@ -1,5 +1,5 @@
1
- import { Quote } from "@bunnyapp/common";
2
- import { EditingQuoteDataType } from "../SubscriptionsListContainer";
1
+ import { Quote } from '@bunnyapp/common';
2
+ import { EditingQuoteDataType } from '../SubscriptionsListContainer';
3
3
  declare const QuoteChangeSummarySection: ({ editingQuote, editingQuoteData, openCheckout, setEditingQuoteData, }: {
4
4
  editingQuote?: Quote | undefined;
5
5
  editingQuoteData?: EditingQuoteDataType | undefined;
@@ -21,4 +21,4 @@ export declare const isSubscriptionTrial: (subscription: Subscription) => boolea
21
21
  export declare const isDiscount: (kind?: QuoteChangeKind) => boolean;
22
22
  export declare const hasPriceTiers: (charge: SubscriptionCharge) => boolean;
23
23
  export declare const hasMultiplePriceTiers: (charge: SubscriptionCharge) => boolean;
24
- export declare const getApplicablePriceTier: (charge: SubscriptionCharge, currencyId: string) => string;
24
+ export declare const getApplicablePriceTier: (charge: SubscriptionCharge, currencyId: string, priceDecimals: number) => string;
@@ -1,3 +1,3 @@
1
1
  import { Transaction } from '@bunnyapp/common';
2
2
  import { TransactionDateType } from '../TransactionsListContext';
3
- export declare function transactionDateToDisplay(transaction: Transaction, transactionDateType: TransactionDateType): string;
3
+ export declare function transactionDateToDisplay(transaction: Transaction, transactionDateType: TransactionDateType): any;
package/dist/esm/index.js CHANGED
@@ -143,7 +143,7 @@ var BrandContext = createContext({
143
143
  });
144
144
 
145
145
  // This will be replaced at build time by rollup-plugin-replace
146
- var PACKAGE_VERSION = '1.0.76-beta.6';
146
+ var PACKAGE_VERSION = '1.0.76-beta.8';
147
147
  var createRequestHeaders = function (token) {
148
148
  var headers = createClientDevHeaders(token);
149
149
  // Add the components version header
@@ -22676,7 +22676,7 @@ var hasMultiplePriceTiers = function (charge) {
22676
22676
  var _a;
22677
22677
  return ((_a = charge === null || charge === void 0 ? void 0 : charge.priceTiers) === null || _a === void 0 ? void 0 : _a.length) > 1;
22678
22678
  };
22679
- var getApplicablePriceTier = function (charge, currencyId) {
22679
+ var getApplicablePriceTier = function (charge, currencyId, priceDecimals) {
22680
22680
  var _a;
22681
22681
  if (!((_a = charge.priceTiers) === null || _a === void 0 ? void 0 : _a.length))
22682
22682
  return '';
@@ -22710,8 +22710,8 @@ var getApplicablePriceTier = function (charge, currencyId) {
22710
22710
  var nextTier = charge.priceTiers[tierIndex + 1];
22711
22711
  var ends = nextTier ? nextTier.starts - 1 : '∞';
22712
22712
  return hasMultiplePriceTiers(charge)
22713
- ? "".concat(starts, "-").concat(ends, ": ").concat(formatCurrency(selectedTier.price, currencyId))
22714
- : "".concat(formatCurrency(selectedTier.price, currencyId));
22713
+ ? "".concat(starts, "-").concat(ends, ": ").concat(formatCurrency(selectedTier.price, currencyId, priceDecimals))
22714
+ : "".concat(formatCurrency(selectedTier.price, currencyId, priceDecimals));
22715
22715
  };
22716
22716
 
22717
22717
  var SubscriptionCardActions = function (_a) {
@@ -22829,7 +22829,7 @@ var SubscriptionChargeUnitPrice = function (_a) {
22829
22829
  ? '-'
22830
22830
  : formatCurrency(charge.discountedPrice, currencyId, charge.priceDecimals);
22831
22831
  var isChargeDiscount = isDiscount(charge.kind);
22832
- return (jsx(Fragment, { children: hasPriceTiers(charge) ? (jsx(TieredDisplayDropdown, { charge: charge, currencyId: currencyId, truncatedText: "".concat(charge.kind === QuoteChangeKind.PRICE_UPDATE ? 'new ' : '').concat(getApplicablePriceTier(charge, currencyId)) })) : isChargeDiscount ? ("-".concat(price)) : (price) }));
22832
+ return (jsx(Fragment, { children: hasPriceTiers(charge) ? (jsx(TieredDisplayDropdown, { charge: charge, currencyId: currencyId, truncatedText: "".concat(charge.kind === QuoteChangeKind.PRICE_UPDATE ? 'new ' : '').concat(getApplicablePriceTier(charge, currencyId, charge.priceDecimals)) })) : isChargeDiscount ? ("-".concat(price)) : (price) }));
22833
22833
  };
22834
22834
 
22835
22835
  var Text$6 = Typography.Text;
@@ -23046,17 +23046,17 @@ var QuantityInput = function (_a) {
23046
23046
  var createCharge = useMutation({
23047
23047
  mutationFn: quoteChargeCreate,
23048
23048
  onSuccess: function (response) {
23049
- var _a, _b, _c, _d, _e, _f, _g, _h;
23049
+ var _a, _b, _c, _d;
23050
23050
  if (!(editingQuote === null || editingQuote === void 0 ? void 0 : editingQuote.id)) {
23051
23051
  var isTrial = ((_b = (_a = editedSubscription === null || editedSubscription === void 0 ? void 0 : editedSubscription.subscription) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$2.TRIAL;
23052
23052
  setEditingQuoteData({
23053
- id: (_e = (_d = (_c = response.quoteChargeCreate) === null || _c === void 0 ? void 0 : _c.quoteCharge) === null || _d === void 0 ? void 0 : _d.quoteChange) === null || _e === void 0 ? void 0 : _e.quoteId,
23053
+ id: (_c = response.quoteChange) === null || _c === void 0 ? void 0 : _c.quoteId,
23054
23054
  isTrial: isTrial,
23055
23055
  });
23056
23056
  }
23057
23057
  queryClient.invalidateQueries({
23058
23058
  queryKey: QueryKeyFactory.default.createObjectKey({
23059
- id: (_h = (_g = (_f = response.quoteChargeCreate) === null || _f === void 0 ? void 0 : _f.quoteCharge) === null || _g === void 0 ? void 0 : _g.quoteChange) === null || _h === void 0 ? void 0 : _h.quoteId,
23059
+ id: (_d = response.quoteChange) === null || _d === void 0 ? void 0 : _d.quoteId,
23060
23060
  objectName: 'editingQuote',
23061
23061
  token: token,
23062
23062
  }),
@@ -23221,12 +23221,12 @@ var QuoteChangeSummarySection = function (_a) {
23221
23221
  mutationFn: function (quoteId) { return checkout({ quoteId: quoteId, token: token, apiHost: apiHost }); },
23222
23222
  onSuccess: function () {
23223
23223
  setEditingQuoteData(undefined);
23224
- showSuccessNotification("Subscription updated successfully");
23224
+ showSuccessNotification('Subscription updated successfully');
23225
23225
  },
23226
23226
  });
23227
- return (jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-items-end" }, { children: [editingQuote && (jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-mb-8" }, { children: [jsx("div", __assign({ className: "bunny-text-slate-500 bunny-text-right bunny-text-xs bunny-mb-2" }, { children: "TOTAL" })), jsx("div", __assign({ className: "bunny-text-right ".concat(isMobile ? "bunny-text-2xl" : "bunny-text-xl") }, { children: formatCurrency(getQuoteAmountDue(editingQuote), (editingQuote === null || editingQuote === void 0 ? void 0 : editingQuote.currencyId) || "") }))] }))), jsx("div", __assign({ className: "bunny-flex bunny-items-center bunny-justify-end ".concat(isMobile ? "bunny-w-full" : "") }, { children: jsx(Button, __assign({ className: "bunny-w-full", onClick: (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.isTrial)
23227
+ return (jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-items-end" }, { children: [editingQuote && (jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-mb-8" }, { children: [jsx("div", __assign({ className: "bunny-text-slate-500 bunny-text-right bunny-text-xs bunny-mb-2" }, { children: "TOTAL" })), jsx("div", __assign({ className: "bunny-text-right ".concat(isMobile ? 'bunny-text-2xl' : 'bunny-text-xl') }, { children: formatCurrency(getQuoteAmountDue(editingQuote), (editingQuote === null || editingQuote === void 0 ? void 0 : editingQuote.currencyId) || '') }))] }))), jsx("div", __assign({ className: "bunny-flex bunny-items-center bunny-justify-end ".concat(isMobile ? 'bunny-w-full' : '') }, { children: jsx(Button, __assign({ className: "bunny-w-full", onClick: (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.isTrial)
23228
23228
  ? function () { return trialUpgradeMutation.mutate(editingQuoteData.id); }
23229
- : openCheckout, disabled: !editingQuoteData, size: isMobile ? "large" : "middle", type: "primary" }, { children: (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.isTrial) ? "Activate Trial" : "Proceed to checkout" })) }))] })));
23229
+ : openCheckout, disabled: !editingQuoteData || !editingQuote, size: isMobile ? 'large' : 'middle', type: "primary" }, { children: (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.isTrial) ? 'Activate Trial' : 'Proceed to checkout' })) }))] })));
23230
23230
  };
23231
23231
 
23232
23232
  var QUANTITY_CHANGE_HEADER_TITLE = 'Update unit quantity';
@@ -43,16 +43,9 @@ export declare const filterUniqueFeatures: ({ availablePriceLists, }: {
43
43
  name: string;
44
44
  periodMonths: 0 | 1 | 3 | 6 | 12;
45
45
  planId: string;
46
- priceAdjustmentAction?: import("@bunnyapp/common").PriceAdjustmentAction | undefined;
47
- priceAdjustmentActionOptions?: string[] | undefined;
48
- priceAdjustmentPercentage?: number | undefined;
49
- priceAdjustmentTiming?: import("@bunnyapp/common").PriceAdjustmentTiming | undefined;
50
- priceAdjustmentTimingOptions?: string[] | undefined;
51
46
  priceDescription?: string | undefined;
52
47
  product: Product;
53
48
  productId?: string | undefined;
54
- renewalTermMonths?: number | undefined;
55
- showPriceAsMonthly?: boolean | undefined;
56
49
  sku?: string | undefined;
57
50
  trialAllowed: boolean;
58
51
  trialExpirationAction?: ("CANCEL" | "ACTIVATE") | undefined;
@@ -1,5 +1,5 @@
1
- import { Quote } from "@bunnyapp/common";
2
- import { EditingQuoteDataType } from "../SubscriptionsListContainer";
1
+ import { Quote } from '@bunnyapp/common';
2
+ import { EditingQuoteDataType } from '../SubscriptionsListContainer';
3
3
  declare const QuoteChangeSummarySection: ({ editingQuote, editingQuoteData, openCheckout, setEditingQuoteData, }: {
4
4
  editingQuote?: Quote | undefined;
5
5
  editingQuoteData?: EditingQuoteDataType | undefined;
@@ -21,4 +21,4 @@ export declare const isSubscriptionTrial: (subscription: Subscription) => boolea
21
21
  export declare const isDiscount: (kind?: QuoteChangeKind) => boolean;
22
22
  export declare const hasPriceTiers: (charge: SubscriptionCharge) => boolean;
23
23
  export declare const hasMultiplePriceTiers: (charge: SubscriptionCharge) => boolean;
24
- export declare const getApplicablePriceTier: (charge: SubscriptionCharge, currencyId: string) => string;
24
+ export declare const getApplicablePriceTier: (charge: SubscriptionCharge, currencyId: string, priceDecimals: number) => string;
@@ -1,3 +1,3 @@
1
1
  import { Transaction } from '@bunnyapp/common';
2
2
  import { TransactionDateType } from '../TransactionsListContext';
3
- export declare function transactionDateToDisplay(transaction: Transaction, transactionDateType: TransactionDateType): string;
3
+ export declare function transactionDateToDisplay(transaction: Transaction, transactionDateType: TransactionDateType): any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bunnyapp/components",
3
- "version": "1.0.76-beta.6",
3
+ "version": "1.0.76-beta.8",
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",
@@ -64,7 +64,7 @@
64
64
  },
65
65
  "peerDependencies": {
66
66
  "@ant-design/icons": "^5.6.1",
67
- "@bunnyapp/common": "^1.0.66-beta.16",
67
+ "@bunnyapp/common": "^1.0.66-beta.17",
68
68
  "@fortawesome/fontawesome-svg-core": "^6.7.2",
69
69
  "@fortawesome/free-brands-svg-icons": "^6.7.2",
70
70
  "@fortawesome/free-regular-svg-icons": "^6.7.2",