@bunnyapp/components 1.6.0-beta.1 → 1.6.0-beta.3

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/README.md CHANGED
@@ -54,6 +54,25 @@ npm run codegen
54
54
  npx gql-tada doctor
55
55
  ```
56
56
 
57
+ ### Deprecating @bunnyapp/common
58
+
59
+ We are gradually deprecating `@bunnyapp/common` and moving types and enums locally to this repository. When something is moved from `@bunnyapp/common`, follow this pattern:
60
+
61
+ 1. **Create local definitions**:
62
+ - **Enums** → Create in `src/enums/` directory (e.g., `src/enums/SubscriptionState.ts`)
63
+ - **Types** → Create in `src/types/` directory (e.g., `src/types/billingDetails.ts`)
64
+
65
+ 2. **Update imports incrementally**: Only update the files that need the change. Other files can continue importing from `@bunnyapp/common` until they need to be updated.
66
+
67
+ 3. **Example pattern**:
68
+ ```typescript
69
+ // Before (from @bunnyapp/common)
70
+ import { SubscriptionState } from '@bunnyapp/common';
71
+
72
+ // After (local enum)
73
+ import SubscriptionState from '../enums/SubscriptionState';
74
+ ```
75
+
57
76
  ### Storybook stories
58
77
 
59
78
  To view the storybook stories, run `npx storybook dev`.
package/dist/cjs/index.js CHANGED
@@ -52,7 +52,7 @@ var css_248z = ":root {\n --row-background: #ffffff;\n --row-background-altern
52
52
  styleInject(css_248z);
53
53
 
54
54
  // This will be replaced at build time by rollup-plugin-replace
55
- const PACKAGE_VERSION = '1.5.0';
55
+ const PACKAGE_VERSION = '1.6.0-beta.2';
56
56
  const createRequestHeaders = (token) => {
57
57
  const headers = createClientDevHeaders({ token });
58
58
  // Add the components version header
@@ -22164,9 +22164,21 @@ const useHasTaxPlugin = ({ apiHost, token, }) => {
22164
22164
  return Boolean(plugins === null || plugins === void 0 ? void 0 : plugins.some((plugin) => plugin.type === "taxation"));
22165
22165
  };
22166
22166
 
22167
+ var SubscriptionState;
22168
+ (function (SubscriptionState) {
22169
+ SubscriptionState["ACTIVE"] = "ACTIVE";
22170
+ SubscriptionState["TRIAL"] = "TRIAL";
22171
+ SubscriptionState["PENDING"] = "PENDING";
22172
+ SubscriptionState["EXPIRED"] = "EXPIRED";
22173
+ SubscriptionState["CANCELED"] = "CANCELED";
22174
+ SubscriptionState["TRIAL_EXPIRED"] = "TRIAL_EXPIRED";
22175
+ })(SubscriptionState || (SubscriptionState = {}));
22176
+ var SubscriptionState$1 = SubscriptionState;
22177
+
22167
22178
  function shouldShowCouponEditor(quote, activeCouponsExist, upgradingSubscription) {
22168
- var _a;
22169
- const upgradingFromTrial = ((_a = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === common.SubscriptionState.TRIAL;
22179
+ var _a, _b;
22180
+ const upgradingFromTrial = ((_a = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$1.TRIAL ||
22181
+ ((_b = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$1.TRIAL_EXPIRED;
22170
22182
  function upgradingFromFree() {
22171
22183
  const totalPrice = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.charges.reduce((acc, charge) => acc + Number((charge === null || charge === void 0 ? void 0 : charge.discountedPrice) || 0), 0);
22172
22184
  return totalPrice === 0;
@@ -0,0 +1,9 @@
1
+ declare enum SubscriptionState {
2
+ ACTIVE = "ACTIVE",
3
+ TRIAL = "TRIAL",
4
+ PENDING = "PENDING",
5
+ EXPIRED = "EXPIRED",
6
+ CANCELED = "CANCELED",
7
+ TRIAL_EXPIRED = "TRIAL_EXPIRED"
8
+ }
9
+ export default SubscriptionState;
package/dist/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
2
  import { createContext, useContext, useMemo, useState, useEffect, useRef, useCallback, Fragment as Fragment$1 } from 'react';
3
3
  import { DownloadOutlined, CreditCardOutlined, EllipsisOutlined, BankOutlined, SearchOutlined, CheckCircleFilled, CloseOutlined, InfoCircleOutlined } from '@ant-design/icons';
4
- import { gqlRequest as gqlRequest$1, createClientDevHeaders as createClientDevHeaders$1, X_BUNNY_COMPONENTS_VERSION_HEADER_NAME, DEFAULT_ACCENT_COLOR, DEFAULT_BRAND_COLOR, DEFAULT_SECONDARY_COLOR, DEFAULT_TOP_NAV_IMAGE_URL, QueryKeyFactory, useIsMobile, isColorTooDark, INPUT_BORDER_COLOR, SLATE_50, SLATE_400, SLATE_200, request as request$1, PRIMARY_COLOR, useErrorNotification, invokePlugin, useAllErrorFormats, formatCurrency, GRAY_500, GRAY_200, useSuccessNotification, PAYABLE_INVOICE_STATES, BreakpointNumbers, useGraphQLmutation, useInfoNotification, formatDate, TransactionState, SLATE_600, WHITE, TransactionKind, SLATE_500, Lists, SubscriptionState, QuoteChangeKind, getAccount, BillingPeriod, MODAL_MAX_HEIGHT, DataInterval, PricingModel, ChargeType, StringUtils, PERIOD_LABELS, PricingStyle, SLATE_100 } from '@bunnyapp/common';
4
+ import { gqlRequest as gqlRequest$1, createClientDevHeaders as createClientDevHeaders$1, X_BUNNY_COMPONENTS_VERSION_HEADER_NAME, DEFAULT_ACCENT_COLOR, DEFAULT_BRAND_COLOR, DEFAULT_SECONDARY_COLOR, DEFAULT_TOP_NAV_IMAGE_URL, QueryKeyFactory, useIsMobile, isColorTooDark, INPUT_BORDER_COLOR, SLATE_50, SLATE_400, SLATE_200, request as request$1, PRIMARY_COLOR, useErrorNotification, invokePlugin, useAllErrorFormats, formatCurrency, GRAY_500, GRAY_200, useSuccessNotification, PAYABLE_INVOICE_STATES, BreakpointNumbers, useGraphQLmutation, useInfoNotification, formatDate, TransactionState, SLATE_600, WHITE, TransactionKind, SLATE_500, Lists, QuoteChangeKind, getAccount, BillingPeriod, MODAL_MAX_HEIGHT, DataInterval, SubscriptionState as SubscriptionState$2, PricingModel, ChargeType, StringUtils, PERIOD_LABELS, PricingStyle, SLATE_100 } from '@bunnyapp/common';
5
5
  import { ConfigProvider, Spin, Button, theme as theme$1, Tag, Dropdown, Typography, Input, Modal, Checkbox, Skeleton, Collapse, Form, Tooltip, Drawer, Card as Card$1, Divider, Select, Image, Popconfirm, Table, Radio, Space, Switch } from 'antd';
6
6
  import { Markup } from 'interweave';
7
7
  import request, { GraphQLClient } from 'graphql-request';
@@ -50,7 +50,7 @@ var css_248z = ":root {\n --row-background: #ffffff;\n --row-background-altern
50
50
  styleInject(css_248z);
51
51
 
52
52
  // This will be replaced at build time by rollup-plugin-replace
53
- const PACKAGE_VERSION = '1.5.0';
53
+ const PACKAGE_VERSION = '1.6.0-beta.2';
54
54
  const createRequestHeaders = (token) => {
55
55
  const headers = createClientDevHeaders({ token });
56
56
  // Add the components version header
@@ -22162,9 +22162,21 @@ const useHasTaxPlugin = ({ apiHost, token, }) => {
22162
22162
  return Boolean(plugins === null || plugins === void 0 ? void 0 : plugins.some((plugin) => plugin.type === "taxation"));
22163
22163
  };
22164
22164
 
22165
+ var SubscriptionState;
22166
+ (function (SubscriptionState) {
22167
+ SubscriptionState["ACTIVE"] = "ACTIVE";
22168
+ SubscriptionState["TRIAL"] = "TRIAL";
22169
+ SubscriptionState["PENDING"] = "PENDING";
22170
+ SubscriptionState["EXPIRED"] = "EXPIRED";
22171
+ SubscriptionState["CANCELED"] = "CANCELED";
22172
+ SubscriptionState["TRIAL_EXPIRED"] = "TRIAL_EXPIRED";
22173
+ })(SubscriptionState || (SubscriptionState = {}));
22174
+ var SubscriptionState$1 = SubscriptionState;
22175
+
22165
22176
  function shouldShowCouponEditor(quote, activeCouponsExist, upgradingSubscription) {
22166
- var _a;
22167
- const upgradingFromTrial = ((_a = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState.TRIAL;
22177
+ var _a, _b;
22178
+ const upgradingFromTrial = ((_a = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$1.TRIAL ||
22179
+ ((_b = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$1.TRIAL_EXPIRED;
22168
22180
  function upgradingFromFree() {
22169
22181
  const totalPrice = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.charges.reduce((acc, charge) => acc + Number((charge === null || charge === void 0 ? void 0 : charge.discountedPrice) || 0), 0);
22170
22182
  return totalPrice === 0;
@@ -22855,29 +22867,29 @@ const TAG_COLORS = {
22855
22867
 
22856
22868
  const canSubscriptionUpgradeFromTrial = (subscription) => {
22857
22869
  var _a;
22858
- return (((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState.TRIAL &&
22870
+ return (((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.TRIAL &&
22859
22871
  subscription.plan.selfServiceBuy) ||
22860
22872
  false;
22861
22873
  };
22862
22874
  const canSubscriptionUpgradeFromTrialExpired = (subscription) => {
22863
22875
  var _a;
22864
- return (((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState.TRIAL_EXPIRED &&
22876
+ return (((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.TRIAL_EXPIRED &&
22865
22877
  subscription.plan.selfServiceBuy) ||
22866
22878
  false;
22867
22879
  };
22868
22880
  const isSubscriptionNotActive = (subscription) => {
22869
22881
  var _a, _b, _c;
22870
- return ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState.EXPIRED ||
22871
- ((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState.CANCELED ||
22872
- ((_c = subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === SubscriptionState.TRIAL_EXPIRED;
22882
+ return ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.EXPIRED ||
22883
+ ((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$2.CANCELED ||
22884
+ ((_c = subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === SubscriptionState$2.TRIAL_EXPIRED;
22873
22885
  };
22874
22886
  const isSubscriptionActiveOrPending = (subscription) => {
22875
22887
  var _a, _b;
22876
- return ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState.ACTIVE ||
22877
- ((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState.PENDING;
22888
+ return ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.ACTIVE ||
22889
+ ((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$2.PENDING;
22878
22890
  };
22879
- const isSubscriptionTrial = (subscription) => { var _a; return ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState.TRIAL; };
22880
- const isSubscriptionTrialExpired = (subscription) => { var _a; return ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState.TRIAL_EXPIRED; };
22891
+ const isSubscriptionTrial = (subscription) => { var _a; return ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.TRIAL; };
22892
+ const isSubscriptionTrialExpired = (subscription) => { var _a; return ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.TRIAL_EXPIRED; };
22881
22893
  // Helper function to check if charge is a discount
22882
22894
  const isDiscount = (kind) => kind === QuoteChangeKind.DISCOUNT || kind === QuoteChangeKind.FREE_PERIOD_DISCOUNT;
22883
22895
  const hasPriceTiers = (charge) => {
@@ -22946,12 +22958,12 @@ const { Text: Text$f } = Typography;
22946
22958
  const getSubscriptionStatusText = (subscription) => {
22947
22959
  const { cancellationDate, state, evergreen, endDate, trialEndDate, trialStartDate, startDate, trialExpirationAction, } = subscription;
22948
22960
  const stateUpperCased = state === null || state === void 0 ? void 0 : state.toUpperCase();
22949
- const isActive = stateUpperCased === SubscriptionState.ACTIVE;
22950
- const isPending = stateUpperCased === SubscriptionState.PENDING;
22951
- const isCanceled = stateUpperCased === SubscriptionState.CANCELED;
22952
- const isExpired = stateUpperCased === SubscriptionState.EXPIRED;
22953
- const isTrialExpired = stateUpperCased === SubscriptionState.TRIAL_EXPIRED;
22954
- const isTrial = stateUpperCased === SubscriptionState.TRIAL;
22961
+ const isActive = stateUpperCased === SubscriptionState$2.ACTIVE;
22962
+ const isPending = stateUpperCased === SubscriptionState$2.PENDING;
22963
+ const isCanceled = stateUpperCased === SubscriptionState$2.CANCELED;
22964
+ const isExpired = stateUpperCased === SubscriptionState$2.EXPIRED;
22965
+ const isTrialExpired = stateUpperCased === SubscriptionState$2.TRIAL_EXPIRED;
22966
+ const isTrial = stateUpperCased === SubscriptionState$2.TRIAL;
22955
22967
  if (cancellationDate && (isActive || isPending || isTrial))
22956
22968
  return (jsxs(CustomizedTag, { color: "red", children: ["Canceled - ends on ", formatDate(cancellationDate)] }));
22957
22969
  if (cancellationDate && isCanceled)
@@ -23357,9 +23369,9 @@ const useQuoteCreate = ({ upgradingSubscription, selectedPriceList, token, }) =>
23357
23369
  return;
23358
23370
  }
23359
23371
  const buyingAddonsForCurrentSubscription = (upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.priceList.id) === (selectedPriceList === null || selectedPriceList === void 0 ? void 0 : selectedPriceList.id);
23360
- const isActivatingTrialSubscription = ((_a = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState.TRIAL &&
23372
+ const isActivatingTrialSubscription = ((_a = upgradingSubscription === null || upgradingSubscription === void 0 ? void 0 : upgradingSubscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.TRIAL &&
23361
23373
  upgradingSubscription.priceList.id === (selectedPriceList === null || selectedPriceList === void 0 ? void 0 : selectedPriceList.id);
23362
- const isActivatingExpiredTrialSubscription = ((_b = upgradingSubscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState.TRIAL_EXPIRED &&
23374
+ const isActivatingExpiredTrialSubscription = ((_b = upgradingSubscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$2.TRIAL_EXPIRED &&
23363
23375
  upgradingSubscription.priceList.id === (selectedPriceList === null || selectedPriceList === void 0 ? void 0 : selectedPriceList.id);
23364
23376
  if (isActivatingTrialSubscription || isActivatingExpiredTrialSubscription) {
23365
23377
  subscriptionActivate({
@@ -24222,9 +24234,9 @@ const PriceListCard = ({ hideButton, isSelected, priceList, subscriptions, trial
24222
24234
  const subscriptionPlan = subscriptions === null || subscriptions === void 0 ? void 0 : subscriptions.find(subscription => {
24223
24235
  var _a, _b, _c;
24224
24236
  return subscription.plan.id === priceList.plan.id &&
24225
- ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) !== SubscriptionState.CANCELED &&
24226
- ((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) !== SubscriptionState.EXPIRED &&
24227
- ((_c = subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) !== SubscriptionState.TRIAL_EXPIRED;
24237
+ ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) !== SubscriptionState$2.CANCELED &&
24238
+ ((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) !== SubscriptionState$2.EXPIRED &&
24239
+ ((_c = subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) !== SubscriptionState$2.TRIAL_EXPIRED;
24228
24240
  });
24229
24241
  if (!activeCharge) {
24230
24242
  return null;
@@ -24621,7 +24633,7 @@ const PlanAddonsCard = ({ selectedPriceList, subscriptions, addonPlans, selected
24621
24633
  const addonSubscriptionIds = currentSubscription === null || currentSubscription === void 0 ? void 0 : currentSubscription.addonSubscriptions;
24622
24634
  const addonSubscriptions = addonSubscriptionIds === null || addonSubscriptionIds === void 0 ? void 0 : addonSubscriptionIds.map(addonSubscription => subscriptions.find(subscription => subscription.id === addonSubscription.id));
24623
24635
  // filter out cancelled addons
24624
- const activeAddonSubscriptions = addonSubscriptions === null || addonSubscriptions === void 0 ? void 0 : addonSubscriptions.filter(addonSubscription => (addonSubscription === null || addonSubscription === void 0 ? void 0 : addonSubscription.state) !== SubscriptionState.CANCELED);
24636
+ const activeAddonSubscriptions = addonSubscriptions === null || addonSubscriptions === void 0 ? void 0 : addonSubscriptions.filter(addonSubscription => (addonSubscription === null || addonSubscription === void 0 ? void 0 : addonSubscription.state) !== SubscriptionState$2.CANCELED);
24625
24637
  return activeAddonSubscriptions === null || activeAddonSubscriptions === void 0 ? void 0 : activeAddonSubscriptions.some(addonSubscription => (addonSubscription === null || addonSubscription === void 0 ? void 0 : addonSubscription.priceList.id) === priceList.id);
24626
24638
  }
24627
24639
  return (jsxs(Text$4, { className: `bunny-flex bunny-flex-col ${className}`, children: [jsx(AddonPlanModal, { onClose: () => setSelectedAddonPriceList(undefined), priceList: selectedAddonPriceList }), addonPriceLists.length > 0 && (jsxs(Fragment, { children: [jsx("div", { className: "bunny-text-slate-500 bunny-text-xs bunny-font-medium", children: 'Add-on plans'.toUpperCase() }), jsx("div", { className: "bunny-flex bunny-flex-col", children: addonPriceLists.map(addonPriceList => {
@@ -25429,16 +25441,16 @@ const Subscriptions = ({ handlePortalErrors, companyName, noSubscriptionsCompone
25429
25441
  const allSubscriptionsInactive = (_c = (_b = subscriptionsData === null || subscriptionsData === void 0 ? void 0 : subscriptionsData.subscriptions) === null || _b === void 0 ? void 0 : _b.nodes) === null || _c === void 0 ? void 0 : _c.every(maskedSubscription => {
25430
25442
  var _a, _b, _c;
25431
25443
  const subscription = readFragment(Subscriptions_SubscriptionFragment, maskedSubscription);
25432
- return (((_a = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState.EXPIRED ||
25433
- ((_b = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState.TRIAL_EXPIRED ||
25434
- ((_c = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === SubscriptionState.CANCELED);
25444
+ return (((_a = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.EXPIRED ||
25445
+ ((_b = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$2.TRIAL_EXPIRED ||
25446
+ ((_c = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === SubscriptionState$2.CANCELED);
25435
25447
  });
25436
25448
  const hasInactiveSubscriptions = (_e = (_d = subscriptionsData === null || subscriptionsData === void 0 ? void 0 : subscriptionsData.subscriptions) === null || _d === void 0 ? void 0 : _d.nodes) === null || _e === void 0 ? void 0 : _e.some(maskedSubscription => {
25437
25449
  var _a, _b, _c;
25438
25450
  const subscription = readFragment(Subscriptions_SubscriptionFragment, maskedSubscription);
25439
- return (((_a = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState.EXPIRED ||
25440
- ((_b = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState.TRIAL_EXPIRED ||
25441
- ((_c = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === SubscriptionState.CANCELED);
25451
+ return (((_a = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.EXPIRED ||
25452
+ ((_b = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$2.TRIAL_EXPIRED ||
25453
+ ((_c = subscription === null || subscription === void 0 ? void 0 : subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === SubscriptionState$2.CANCELED);
25442
25454
  });
25443
25455
  useEffect(() => {
25444
25456
  if (allSubscriptionsInactive && subscriptions && subscriptions.length > 0) {
@@ -0,0 +1,9 @@
1
+ declare enum SubscriptionState {
2
+ ACTIVE = "ACTIVE",
3
+ TRIAL = "TRIAL",
4
+ PENDING = "PENDING",
5
+ EXPIRED = "EXPIRED",
6
+ CANCELED = "CANCELED",
7
+ TRIAL_EXPIRED = "TRIAL_EXPIRED"
8
+ }
9
+ export default SubscriptionState;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bunnyapp/components",
3
- "version": "1.6.0-beta.1",
3
+ "version": "1.6.0-beta.3",
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",