@bunnyapp/components 1.0.43 → 1.0.44

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
@@ -20439,8 +20439,7 @@ var SubscriptionCardDesktopRow = function (_a) {
20439
20439
  // Derived state
20440
20440
  var isRamp = charge.isRamp;
20441
20441
  var prevCharge = subscription.charges[chargeIndex - 1];
20442
- var isFirstRampRow = chargeIndex === 0 ||
20443
- (prevCharge === null || prevCharge === void 0 ? void 0 : prevCharge.priceListChargeId) !== charge.priceListChargeId;
20442
+ var isFirstRampRow = chargeIndex === 0 || (prevCharge === null || prevCharge === void 0 ? void 0 : prevCharge.priceListChargeId) !== charge.priceListChargeId;
20444
20443
  var chargePeriod = "".concat(common.formatDate(charge.startDate), " - ").concat(common.formatDate(charge.endDate));
20445
20444
  // Queries
20446
20445
  var data = reactQuery.useQuery({
@@ -20454,18 +20453,15 @@ var SubscriptionCardDesktopRow = function (_a) {
20454
20453
  apiHost: apiHost,
20455
20454
  });
20456
20455
  },
20457
- enabled: (!isRamp || (isRamp && isFirstRampRow)) &&
20458
- charge.chargeType === common.ChargeType.USAGE,
20456
+ enabled: (!isRamp || (isRamp && isFirstRampRow)) && charge.chargeType === common.ChargeType.USAGE,
20459
20457
  }).data;
20460
20458
  var isRampFirstRow = isRamp && chargeIndex === 0;
20461
20459
  var isTrial = charge.trial;
20462
- var dontShowChargeName = (prevCharge === null || prevCharge === void 0 ? void 0 : prevCharge.id) === charge.id &&
20460
+ var dontShowChargeName = (prevCharge === null || prevCharge === void 0 ? void 0 : prevCharge.priceListChargeId) === charge.priceListChargeId &&
20463
20461
  (!isTrial || prevCharge.trial) &&
20464
20462
  (isTrial || !prevCharge.trial);
20465
20463
  var isDiscount = charge.kind === common.SubscriptionChargeKind.DISCOUNT;
20466
- return (jsxRuntime.jsxs("div", __assign({ className: "contents" }, { children: [(isRampFirstRow || !isRamp) && (jsxRuntime.jsx(SubscriptionsListCell, __assign({ gridColumn: isRamp ? "1/-1" : "1" }, { children: jsxRuntime.jsx("div", __assign({ className: "flex items-center gap-2 ".concat(isDiscount ? "pl-4" : "") }, { children: jsxRuntime.jsx("div", { children: isRampFirstRow || (!isRamp && !dontShowChargeName)
20467
- ? charge.name
20468
- : "" }) })) }))), jsxRuntime.jsx(SubscriptionsListCell, __assign({ gridColumn: 2 }, { children: jsxRuntime.jsx("div", { children: chargePeriod }) })), jsxRuntime.jsx(SubscriptionsListCell, __assign({ right: true }, { children: charge.kind === common.SubscriptionChargeKind.DISCOUNT
20464
+ return (jsxRuntime.jsxs("div", __assign({ className: "contents" }, { children: [(isRampFirstRow || !isRamp) && (jsxRuntime.jsx(SubscriptionsListCell, __assign({ gridColumn: isRamp ? "1/-1" : "1" }, { children: jsxRuntime.jsx("div", __assign({ className: "flex items-center gap-2 ".concat(isDiscount ? "pl-4" : "") }, { children: jsxRuntime.jsx("div", { children: isRampFirstRow || (!isRamp && !dontShowChargeName) ? charge.name : "" }) })) }))), jsxRuntime.jsx(SubscriptionsListCell, __assign({ gridColumn: 2 }, { children: jsxRuntime.jsx("div", { children: chargePeriod }) })), jsxRuntime.jsx(SubscriptionsListCell, __assign({ right: true }, { children: charge.kind === common.SubscriptionChargeKind.DISCOUNT
20469
20465
  ? ""
20470
20466
  : charge.chargeType === common.ChargeType.USAGE
20471
20467
  ? data && jsxRuntime.jsx(FeatureUsageGraph, { charge: charge, featureUsage: data })
@@ -2,7 +2,7 @@ import { PlanChangeOptions, Subscription } from "@bunnyapp/common";
2
2
  declare const SubscriptionCardActions: ({ onChangePlanClick, onCancelSubscriptionClick, planChangeOptions, subscription, }: {
3
3
  onChangePlanClick: (subscription: Subscription) => void;
4
4
  onCancelSubscriptionClick: (subscription: Subscription) => void;
5
- planChangeOptions?: any;
5
+ planChangeOptions?: PlanChangeOptions | undefined;
6
6
  subscription: Subscription;
7
7
  }) => import("react/jsx-runtime").JSX.Element | null;
8
8
  export default SubscriptionCardActions;
@@ -2,7 +2,7 @@ import { PlanChangeOptions, Subscription } from "@bunnyapp/common";
2
2
  declare const SubscriptionCardHeader: ({ onChangePlanClick, onCancelSubscriptionClick, planChangeOptions, subscription, }: {
3
3
  onChangePlanClick?: ((subscription: Subscription) => void) | undefined;
4
4
  onCancelSubscriptionClick?: ((subscription: Subscription) => void) | undefined;
5
- planChangeOptions?: any;
5
+ planChangeOptions?: PlanChangeOptions | undefined;
6
6
  subscription: Subscription;
7
7
  }) => import("react/jsx-runtime").JSX.Element;
8
8
  export default SubscriptionCardHeader;
@@ -3,7 +3,7 @@ declare const SubscriptionsList: ({ hideExpired, onChangePlanClick, onCancelSubs
3
3
  hideExpired: boolean;
4
4
  onChangePlanClick?: ((subscription: Subscription) => void) | undefined;
5
5
  onCancelSubscriptionClick?: ((subscription: Subscription) => void) | undefined;
6
- planChangeOptions?: any;
6
+ planChangeOptions?: PlanChangeOptions | undefined;
7
7
  subscriptions: Subscription[];
8
8
  }) => import("react/jsx-runtime").JSX.Element;
9
9
  export default SubscriptionsList;
@@ -2,7 +2,7 @@ import { PlanChangeOptions, Subscription } from "@bunnyapp/common";
2
2
  declare const SubscriptionCardDesktop: ({ onChangePlanClick, onCancelSubscriptionClick, planChangeOptions, subscription, }: {
3
3
  onChangePlanClick?: ((subscription: Subscription) => void) | undefined;
4
4
  onCancelSubscriptionClick?: ((subscription: Subscription) => void) | undefined;
5
- planChangeOptions?: any;
5
+ planChangeOptions?: PlanChangeOptions | undefined;
6
6
  subscription: Subscription;
7
7
  }) => import("react/jsx-runtime").JSX.Element;
8
8
  export default SubscriptionCardDesktop;
package/dist/esm/index.js CHANGED
@@ -20411,8 +20411,7 @@ var SubscriptionCardDesktopRow = function (_a) {
20411
20411
  // Derived state
20412
20412
  var isRamp = charge.isRamp;
20413
20413
  var prevCharge = subscription.charges[chargeIndex - 1];
20414
- var isFirstRampRow = chargeIndex === 0 ||
20415
- (prevCharge === null || prevCharge === void 0 ? void 0 : prevCharge.priceListChargeId) !== charge.priceListChargeId;
20414
+ var isFirstRampRow = chargeIndex === 0 || (prevCharge === null || prevCharge === void 0 ? void 0 : prevCharge.priceListChargeId) !== charge.priceListChargeId;
20416
20415
  var chargePeriod = "".concat(formatDate(charge.startDate), " - ").concat(formatDate(charge.endDate));
20417
20416
  // Queries
20418
20417
  var data = useQuery({
@@ -20426,18 +20425,15 @@ var SubscriptionCardDesktopRow = function (_a) {
20426
20425
  apiHost: apiHost,
20427
20426
  });
20428
20427
  },
20429
- enabled: (!isRamp || (isRamp && isFirstRampRow)) &&
20430
- charge.chargeType === ChargeType.USAGE,
20428
+ enabled: (!isRamp || (isRamp && isFirstRampRow)) && charge.chargeType === ChargeType.USAGE,
20431
20429
  }).data;
20432
20430
  var isRampFirstRow = isRamp && chargeIndex === 0;
20433
20431
  var isTrial = charge.trial;
20434
- var dontShowChargeName = (prevCharge === null || prevCharge === void 0 ? void 0 : prevCharge.id) === charge.id &&
20432
+ var dontShowChargeName = (prevCharge === null || prevCharge === void 0 ? void 0 : prevCharge.priceListChargeId) === charge.priceListChargeId &&
20435
20433
  (!isTrial || prevCharge.trial) &&
20436
20434
  (isTrial || !prevCharge.trial);
20437
20435
  var isDiscount = charge.kind === SubscriptionChargeKind.DISCOUNT;
20438
- return (jsxs("div", __assign({ className: "contents" }, { children: [(isRampFirstRow || !isRamp) && (jsx(SubscriptionsListCell, __assign({ gridColumn: isRamp ? "1/-1" : "1" }, { children: jsx("div", __assign({ className: "flex items-center gap-2 ".concat(isDiscount ? "pl-4" : "") }, { children: jsx("div", { children: isRampFirstRow || (!isRamp && !dontShowChargeName)
20439
- ? charge.name
20440
- : "" }) })) }))), jsx(SubscriptionsListCell, __assign({ gridColumn: 2 }, { children: jsx("div", { children: chargePeriod }) })), jsx(SubscriptionsListCell, __assign({ right: true }, { children: charge.kind === SubscriptionChargeKind.DISCOUNT
20436
+ return (jsxs("div", __assign({ className: "contents" }, { children: [(isRampFirstRow || !isRamp) && (jsx(SubscriptionsListCell, __assign({ gridColumn: isRamp ? "1/-1" : "1" }, { children: jsx("div", __assign({ className: "flex items-center gap-2 ".concat(isDiscount ? "pl-4" : "") }, { children: jsx("div", { children: isRampFirstRow || (!isRamp && !dontShowChargeName) ? charge.name : "" }) })) }))), jsx(SubscriptionsListCell, __assign({ gridColumn: 2 }, { children: jsx("div", { children: chargePeriod }) })), jsx(SubscriptionsListCell, __assign({ right: true }, { children: charge.kind === SubscriptionChargeKind.DISCOUNT
20441
20437
  ? ""
20442
20438
  : charge.chargeType === ChargeType.USAGE
20443
20439
  ? data && jsx(FeatureUsageGraph, { charge: charge, featureUsage: data })
@@ -2,7 +2,7 @@ import { PlanChangeOptions, Subscription } from "@bunnyapp/common";
2
2
  declare const SubscriptionCardActions: ({ onChangePlanClick, onCancelSubscriptionClick, planChangeOptions, subscription, }: {
3
3
  onChangePlanClick: (subscription: Subscription) => void;
4
4
  onCancelSubscriptionClick: (subscription: Subscription) => void;
5
- planChangeOptions?: any;
5
+ planChangeOptions?: PlanChangeOptions | undefined;
6
6
  subscription: Subscription;
7
7
  }) => import("react/jsx-runtime").JSX.Element | null;
8
8
  export default SubscriptionCardActions;
@@ -2,7 +2,7 @@ import { PlanChangeOptions, Subscription } from "@bunnyapp/common";
2
2
  declare const SubscriptionCardHeader: ({ onChangePlanClick, onCancelSubscriptionClick, planChangeOptions, subscription, }: {
3
3
  onChangePlanClick?: ((subscription: Subscription) => void) | undefined;
4
4
  onCancelSubscriptionClick?: ((subscription: Subscription) => void) | undefined;
5
- planChangeOptions?: any;
5
+ planChangeOptions?: PlanChangeOptions | undefined;
6
6
  subscription: Subscription;
7
7
  }) => import("react/jsx-runtime").JSX.Element;
8
8
  export default SubscriptionCardHeader;
@@ -3,7 +3,7 @@ declare const SubscriptionsList: ({ hideExpired, onChangePlanClick, onCancelSubs
3
3
  hideExpired: boolean;
4
4
  onChangePlanClick?: ((subscription: Subscription) => void) | undefined;
5
5
  onCancelSubscriptionClick?: ((subscription: Subscription) => void) | undefined;
6
- planChangeOptions?: any;
6
+ planChangeOptions?: PlanChangeOptions | undefined;
7
7
  subscriptions: Subscription[];
8
8
  }) => import("react/jsx-runtime").JSX.Element;
9
9
  export default SubscriptionsList;
@@ -2,7 +2,7 @@ import { PlanChangeOptions, Subscription } from "@bunnyapp/common";
2
2
  declare const SubscriptionCardDesktop: ({ onChangePlanClick, onCancelSubscriptionClick, planChangeOptions, subscription, }: {
3
3
  onChangePlanClick?: ((subscription: Subscription) => void) | undefined;
4
4
  onCancelSubscriptionClick?: ((subscription: Subscription) => void) | undefined;
5
- planChangeOptions?: any;
5
+ planChangeOptions?: PlanChangeOptions | undefined;
6
6
  subscription: Subscription;
7
7
  }) => import("react/jsx-runtime").JSX.Element;
8
8
  export default SubscriptionCardDesktop;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bunnyapp/components",
3
- "version": "1.0.43",
3
+ "version": "1.0.44",
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.52",
67
+ "@bunnyapp/common": "^1.0.53",
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",