@bunnyapp/components 1.0.42 → 1.0.43
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 +7 -2
- package/dist/cjs/index.js +10 -76
- package/dist/cjs/src/components/Subscriptions/subscriptionsList/SubscriptionCardActions.d.ts +1 -1
- package/dist/cjs/src/components/Subscriptions/subscriptionsList/SubscriptionCardHeader.d.ts +1 -1
- package/dist/cjs/src/components/Subscriptions/subscriptionsList/SubscriptionsList.d.ts +1 -1
- package/dist/cjs/src/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionCardDesktop.d.ts +1 -1
- package/dist/esm/index.js +11 -77
- package/dist/esm/src/components/Subscriptions/subscriptionsList/SubscriptionCardActions.d.ts +1 -1
- package/dist/esm/src/components/Subscriptions/subscriptionsList/SubscriptionCardHeader.d.ts +1 -1
- package/dist/esm/src/components/Subscriptions/subscriptionsList/SubscriptionsList.d.ts +1 -1
- package/dist/esm/src/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionCardDesktop.d.ts +1 -1
- package/package.json +8 -5
- package/dist/cjs/src/hooks/subscriptions/useSubscriptions.d.ts +0 -5
- package/dist/esm/src/hooks/subscriptions/useSubscriptions.d.ts +0 -5
package/README.md
CHANGED
|
@@ -30,6 +30,11 @@ Ensure all peer dependencies in the package.json are installed.
|
|
|
30
30
|
|
|
31
31
|
To run the development server, run `npm run dev`.
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
### Storybook stories
|
|
34
34
|
|
|
35
|
-
To view the storybook stories, run `
|
|
35
|
+
To view the storybook stories, run `npx storybook dev`.
|
|
36
|
+
|
|
37
|
+
#### Visual tests
|
|
38
|
+
|
|
39
|
+
Once storybook is running, visual tests can be run by clicking on the visual tests tab, and then clicking on the "Run Tests" button.
|
|
40
|
+
Refer to [these docs](https://storybook.js.org/docs/writing-tests/visual-testing#enable-visual-tests) for more information.
|
package/dist/cjs/index.js
CHANGED
|
@@ -19931,8 +19931,8 @@ function InitialSignupForm(_a) {
|
|
|
19931
19931
|
{ required: true, message: "Please input your email!" },
|
|
19932
19932
|
{ type: "email", message: "Please enter a valid email!" },
|
|
19933
19933
|
] }, { children: jsxRuntime.jsx(antd.Input, { placeholder: "Email" }) })), jsxRuntime.jsx(antd.Form.Item, __assign({ name: "accountName", rules: [
|
|
19934
|
-
{ required: true, message: "Please input your
|
|
19935
|
-
] }, { children: jsxRuntime.jsx(antd.Input, { placeholder: "
|
|
19934
|
+
{ required: true, message: "Please input your company name!" },
|
|
19935
|
+
] }, { children: jsxRuntime.jsx(antd.Input, { placeholder: "Company name" }) }))] })), jsxRuntime.jsx(antd.Form.Item, { children: jsxRuntime.jsx(antd.Button, __assign({ type: "primary", onClick: handleSubmit, loading: submitting, className: "w-full mt-4" }, { children: "Proceed to payment" })) })] })));
|
|
19936
19936
|
}
|
|
19937
19937
|
|
|
19938
19938
|
var Title = antd.Typography.Title, Text$4 = antd.Typography.Text;
|
|
@@ -20108,10 +20108,10 @@ var SUBSCRIPTIONS_QUERY = "\nquery subscriptions {\n subscriptions {\n n
|
|
|
20108
20108
|
var getSubscriptions = function (_a) {
|
|
20109
20109
|
var apiHost = _a.apiHost, entityId = _a.entityId, isInPreviewMode = _a.isInPreviewMode, token = _a.token;
|
|
20110
20110
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
20111
|
-
var response;
|
|
20112
|
-
var _b;
|
|
20113
|
-
return __generator(this, function (
|
|
20114
|
-
switch (
|
|
20111
|
+
var response, combinedSubscriptions;
|
|
20112
|
+
var _b, _c;
|
|
20113
|
+
return __generator(this, function (_d) {
|
|
20114
|
+
switch (_d.label) {
|
|
20115
20115
|
case 0: return [4 /*yield*/, common.gqlRequest({
|
|
20116
20116
|
isInPreviewMode: isInPreviewMode,
|
|
20117
20117
|
query: SUBSCRIPTIONS_QUERY,
|
|
@@ -20120,78 +20120,14 @@ var getSubscriptions = function (_a) {
|
|
|
20120
20120
|
apiHost: apiHost,
|
|
20121
20121
|
})];
|
|
20122
20122
|
case 1:
|
|
20123
|
-
response =
|
|
20124
|
-
|
|
20123
|
+
response = _d.sent();
|
|
20124
|
+
combinedSubscriptions = (_c = (_b = response === null || response === void 0 ? void 0 : response.subscriptions) === null || _b === void 0 ? void 0 : _b.nodes) === null || _c === void 0 ? void 0 : _c.map(function (subscription) { return (__assign(__assign({}, subscription), { charges: common.sortSubscriptionCharges(subscription.charges) })); });
|
|
20125
|
+
return [2 /*return*/, combinedSubscriptions];
|
|
20125
20126
|
}
|
|
20126
20127
|
});
|
|
20127
20128
|
});
|
|
20128
20129
|
};
|
|
20129
20130
|
|
|
20130
|
-
var useSubscriptions = function (_a) {
|
|
20131
|
-
var data = _a.data;
|
|
20132
|
-
return react.useMemo(function () {
|
|
20133
|
-
var clonedData = lodashExports.cloneDeep(data);
|
|
20134
|
-
var combinedSubscriptions = clonedData === null || clonedData === void 0 ? void 0 : clonedData.map(function (subscription) {
|
|
20135
|
-
var _a;
|
|
20136
|
-
var orderedSubscriptionCharges = subscription.charges.sort(function (a, b) {
|
|
20137
|
-
if (a.priceListChargeId !== b.priceListChargeId) {
|
|
20138
|
-
return a.priceListChargeId.localeCompare(b.priceListChargeId);
|
|
20139
|
-
}
|
|
20140
|
-
if (a.kind === common.SubscriptionChargeKind.DISCOUNT &&
|
|
20141
|
-
b.kind !== common.SubscriptionChargeKind.DISCOUNT) {
|
|
20142
|
-
return 1;
|
|
20143
|
-
}
|
|
20144
|
-
if (a.kind !== common.SubscriptionChargeKind.DISCOUNT &&
|
|
20145
|
-
b.kind === common.SubscriptionChargeKind.DISCOUNT) {
|
|
20146
|
-
return -1;
|
|
20147
|
-
}
|
|
20148
|
-
return (a.endDate.localeCompare(b.endDate) ||
|
|
20149
|
-
a.startDate.localeCompare(b.startDate));
|
|
20150
|
-
});
|
|
20151
|
-
var isTrial = ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === common.SubscriptionState.TRIAL;
|
|
20152
|
-
var combinedSubscriptionCharges = [];
|
|
20153
|
-
var aggregationCharge;
|
|
20154
|
-
for (var index = 0; index < orderedSubscriptionCharges.length; index++) {
|
|
20155
|
-
var charge = orderedSubscriptionCharges[index];
|
|
20156
|
-
var nextCharge = orderedSubscriptionCharges[index + 1];
|
|
20157
|
-
if (!aggregationCharge)
|
|
20158
|
-
aggregationCharge = charge;
|
|
20159
|
-
// If the next charge is the same priceListChargeId and endDate, aggregate the quantities
|
|
20160
|
-
if (nextCharge &&
|
|
20161
|
-
charge.priceListChargeId === nextCharge.priceListChargeId &&
|
|
20162
|
-
charge.endDate === nextCharge.endDate &&
|
|
20163
|
-
charge.startDate === nextCharge.startDate &&
|
|
20164
|
-
charge.kind === nextCharge.kind) {
|
|
20165
|
-
aggregationCharge.quantity += nextCharge.quantity;
|
|
20166
|
-
// If the next charge is different, push the aggregationCharge to the combinedSubscriptionCharges
|
|
20167
|
-
}
|
|
20168
|
-
else if (nextCharge &&
|
|
20169
|
-
charge.priceListChargeId === nextCharge.priceListChargeId &&
|
|
20170
|
-
(charge.endDate !== nextCharge.endDate ||
|
|
20171
|
-
charge.startDate !== nextCharge.startDate) &&
|
|
20172
|
-
charge.kind === nextCharge.kind &&
|
|
20173
|
-
(!isTrial || charge.trial) &&
|
|
20174
|
-
(isTrial || !charge.trial)) {
|
|
20175
|
-
nextCharge.name = "";
|
|
20176
|
-
combinedSubscriptionCharges.push(aggregationCharge);
|
|
20177
|
-
aggregationCharge = undefined;
|
|
20178
|
-
}
|
|
20179
|
-
else {
|
|
20180
|
-
combinedSubscriptionCharges.push(aggregationCharge);
|
|
20181
|
-
aggregationCharge = undefined;
|
|
20182
|
-
}
|
|
20183
|
-
}
|
|
20184
|
-
subscription.charges = combinedSubscriptionCharges;
|
|
20185
|
-
return subscription;
|
|
20186
|
-
});
|
|
20187
|
-
var subscriptionOrder = Object.values(common.SubscriptionState);
|
|
20188
|
-
combinedSubscriptions === null || combinedSubscriptions === void 0 ? void 0 : combinedSubscriptions.sort(function (a, b) {
|
|
20189
|
-
return subscriptionOrder.indexOf(a.state) - subscriptionOrder.indexOf(b.state);
|
|
20190
|
-
});
|
|
20191
|
-
return combinedSubscriptions;
|
|
20192
|
-
}, [data]);
|
|
20193
|
-
};
|
|
20194
|
-
|
|
20195
20131
|
var ErrorView = function (_a) {
|
|
20196
20132
|
var children = _a.children, message = _a.message;
|
|
20197
20133
|
return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col w-full", style: { marginTop: "80px" } }, { children: [jsxRuntime.jsx("div", __assign({ style: { fontSize: "32px" } }, { children: message })), children] })));
|
|
@@ -20624,14 +20560,12 @@ var Subscriptions = function (_a) {
|
|
|
20624
20560
|
}),
|
|
20625
20561
|
queryFn: function () { return getSubscriptions({ entityId: entityId, token: token, apiHost: apiHost }); },
|
|
20626
20562
|
enabled: Boolean(entityId),
|
|
20627
|
-
}),
|
|
20563
|
+
}), subscriptions = _d.data, subscriptionsAreLoading = _d.isLoading;
|
|
20628
20564
|
var _e = reactQuery.useQuery({
|
|
20629
20565
|
queryKey: common.QueryKeyFactory.default.planChangeOptionsKey({ token: token }),
|
|
20630
20566
|
queryFn: function () { return getPlanChangeOptions({ token: token, apiHost: apiHost }); },
|
|
20631
20567
|
enabled: Boolean(onChangePlanClick),
|
|
20632
20568
|
}), planChangeOptions = _e.data, arePlanChangeOptionsLoading = _e.isLoading;
|
|
20633
|
-
// Derived state
|
|
20634
|
-
var subscriptions = useSubscriptions({ data: rawSubscriptions });
|
|
20635
20569
|
react.useEffect(function () {
|
|
20636
20570
|
if (subscriptions)
|
|
20637
20571
|
onSubscriptionsLoaded === null || onSubscriptionsLoaded === void 0 ? void 0 : onSubscriptionsLoaded(subscriptions);
|
package/dist/cjs/src/components/Subscriptions/subscriptionsList/SubscriptionCardActions.d.ts
CHANGED
|
@@ -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?:
|
|
5
|
+
planChangeOptions?: any;
|
|
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?:
|
|
5
|
+
planChangeOptions?: any;
|
|
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?:
|
|
6
|
+
planChangeOptions?: any;
|
|
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?:
|
|
5
|
+
planChangeOptions?: any;
|
|
6
6
|
subscription: Subscription;
|
|
7
7
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export default SubscriptionCardDesktop;
|
package/dist/esm/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Markup } from 'interweave';
|
|
|
4
4
|
import { ConfigProvider, Button, Typography, Tag, Divider, Popconfirm, Input, Checkbox, Collapse, Skeleton, Modal, Form, Drawer, Card as Card$1, Select, Image, Dropdown } from 'antd';
|
|
5
5
|
import { DownloadOutlined, CreditCardOutlined, BankOutlined, SearchOutlined, CloseOutlined, CheckCircleFilled } from '@ant-design/icons';
|
|
6
6
|
import styled from 'styled-components';
|
|
7
|
-
import { DEFAULT_ACCENT_COLOR, DEFAULT_BRAND_COLOR, DEFAULT_SECONDARY_COLOR, DEFAULT_TOP_NAV_IMAGE_URL, gqlRequest, QueryKeyFactory, useIsMobile, isColorTooDark, MARK_PRO, INPUT_BORDER_COLOR, SLATE_50, SLATE_400, SLATE_200, getPlugins, useAllErrorFormats, formatCurrency, invokePlugin, GRAY_500, GRAY_200, useErrorNotification, useSuccessNotification, getFormattedInvoice, PAYABLE_INVOICE_STATES, BreakpointNumbers, useGraphQLmutation, formatDate, FrontendTransaction, SLATE_600, WHITE, TransactionKind, Lists, getAccount,
|
|
7
|
+
import { DEFAULT_ACCENT_COLOR, DEFAULT_BRAND_COLOR, DEFAULT_SECONDARY_COLOR, DEFAULT_TOP_NAV_IMAGE_URL, gqlRequest, QueryKeyFactory, useIsMobile, isColorTooDark, MARK_PRO, INPUT_BORDER_COLOR, SLATE_50, SLATE_400, SLATE_200, getPlugins, useAllErrorFormats, formatCurrency, invokePlugin, GRAY_500, GRAY_200, useErrorNotification, useSuccessNotification, getFormattedInvoice, PAYABLE_INVOICE_STATES, BreakpointNumbers, useGraphQLmutation, formatDate, FrontendTransaction, SLATE_600, WHITE, TransactionKind, Lists, getAccount, sortSubscriptionCharges, MODAL_MAX_HEIGHT, SLATE_500, DataInterval, SubscriptionState as SubscriptionState$2, TAG_COLORS, ChargeType, SubscriptionChargeKind, PricingModel } from '@bunnyapp/common';
|
|
8
8
|
import { QueryClient, QueryClientProvider, useQuery, useQueryClient, keepPreviousData, useMutation } from '@tanstack/react-query';
|
|
9
9
|
import theme from 'antd/lib/theme/index.js';
|
|
10
10
|
import { RecoilRoot } from 'recoil';
|
|
@@ -19903,8 +19903,8 @@ function InitialSignupForm(_a) {
|
|
|
19903
19903
|
{ required: true, message: "Please input your email!" },
|
|
19904
19904
|
{ type: "email", message: "Please enter a valid email!" },
|
|
19905
19905
|
] }, { children: jsx(Input, { placeholder: "Email" }) })), jsx(Form.Item, __assign({ name: "accountName", rules: [
|
|
19906
|
-
{ required: true, message: "Please input your
|
|
19907
|
-
] }, { children: jsx(Input, { placeholder: "
|
|
19906
|
+
{ required: true, message: "Please input your company name!" },
|
|
19907
|
+
] }, { children: jsx(Input, { placeholder: "Company name" }) }))] })), jsx(Form.Item, { children: jsx(Button, __assign({ type: "primary", onClick: handleSubmit, loading: submitting, className: "w-full mt-4" }, { children: "Proceed to payment" })) })] })));
|
|
19908
19908
|
}
|
|
19909
19909
|
|
|
19910
19910
|
var Title = Typography.Title, Text$4 = Typography.Text;
|
|
@@ -20080,10 +20080,10 @@ var SUBSCRIPTIONS_QUERY = "\nquery subscriptions {\n subscriptions {\n n
|
|
|
20080
20080
|
var getSubscriptions = function (_a) {
|
|
20081
20081
|
var apiHost = _a.apiHost, entityId = _a.entityId, isInPreviewMode = _a.isInPreviewMode, token = _a.token;
|
|
20082
20082
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
20083
|
-
var response;
|
|
20084
|
-
var _b;
|
|
20085
|
-
return __generator(this, function (
|
|
20086
|
-
switch (
|
|
20083
|
+
var response, combinedSubscriptions;
|
|
20084
|
+
var _b, _c;
|
|
20085
|
+
return __generator(this, function (_d) {
|
|
20086
|
+
switch (_d.label) {
|
|
20087
20087
|
case 0: return [4 /*yield*/, gqlRequest({
|
|
20088
20088
|
isInPreviewMode: isInPreviewMode,
|
|
20089
20089
|
query: SUBSCRIPTIONS_QUERY,
|
|
@@ -20092,78 +20092,14 @@ var getSubscriptions = function (_a) {
|
|
|
20092
20092
|
apiHost: apiHost,
|
|
20093
20093
|
})];
|
|
20094
20094
|
case 1:
|
|
20095
|
-
response =
|
|
20096
|
-
|
|
20095
|
+
response = _d.sent();
|
|
20096
|
+
combinedSubscriptions = (_c = (_b = response === null || response === void 0 ? void 0 : response.subscriptions) === null || _b === void 0 ? void 0 : _b.nodes) === null || _c === void 0 ? void 0 : _c.map(function (subscription) { return (__assign(__assign({}, subscription), { charges: sortSubscriptionCharges(subscription.charges) })); });
|
|
20097
|
+
return [2 /*return*/, combinedSubscriptions];
|
|
20097
20098
|
}
|
|
20098
20099
|
});
|
|
20099
20100
|
});
|
|
20100
20101
|
};
|
|
20101
20102
|
|
|
20102
|
-
var useSubscriptions = function (_a) {
|
|
20103
|
-
var data = _a.data;
|
|
20104
|
-
return useMemo(function () {
|
|
20105
|
-
var clonedData = lodashExports.cloneDeep(data);
|
|
20106
|
-
var combinedSubscriptions = clonedData === null || clonedData === void 0 ? void 0 : clonedData.map(function (subscription) {
|
|
20107
|
-
var _a;
|
|
20108
|
-
var orderedSubscriptionCharges = subscription.charges.sort(function (a, b) {
|
|
20109
|
-
if (a.priceListChargeId !== b.priceListChargeId) {
|
|
20110
|
-
return a.priceListChargeId.localeCompare(b.priceListChargeId);
|
|
20111
|
-
}
|
|
20112
|
-
if (a.kind === SubscriptionChargeKind.DISCOUNT &&
|
|
20113
|
-
b.kind !== SubscriptionChargeKind.DISCOUNT) {
|
|
20114
|
-
return 1;
|
|
20115
|
-
}
|
|
20116
|
-
if (a.kind !== SubscriptionChargeKind.DISCOUNT &&
|
|
20117
|
-
b.kind === SubscriptionChargeKind.DISCOUNT) {
|
|
20118
|
-
return -1;
|
|
20119
|
-
}
|
|
20120
|
-
return (a.endDate.localeCompare(b.endDate) ||
|
|
20121
|
-
a.startDate.localeCompare(b.startDate));
|
|
20122
|
-
});
|
|
20123
|
-
var isTrial = ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === SubscriptionState$2.TRIAL;
|
|
20124
|
-
var combinedSubscriptionCharges = [];
|
|
20125
|
-
var aggregationCharge;
|
|
20126
|
-
for (var index = 0; index < orderedSubscriptionCharges.length; index++) {
|
|
20127
|
-
var charge = orderedSubscriptionCharges[index];
|
|
20128
|
-
var nextCharge = orderedSubscriptionCharges[index + 1];
|
|
20129
|
-
if (!aggregationCharge)
|
|
20130
|
-
aggregationCharge = charge;
|
|
20131
|
-
// If the next charge is the same priceListChargeId and endDate, aggregate the quantities
|
|
20132
|
-
if (nextCharge &&
|
|
20133
|
-
charge.priceListChargeId === nextCharge.priceListChargeId &&
|
|
20134
|
-
charge.endDate === nextCharge.endDate &&
|
|
20135
|
-
charge.startDate === nextCharge.startDate &&
|
|
20136
|
-
charge.kind === nextCharge.kind) {
|
|
20137
|
-
aggregationCharge.quantity += nextCharge.quantity;
|
|
20138
|
-
// If the next charge is different, push the aggregationCharge to the combinedSubscriptionCharges
|
|
20139
|
-
}
|
|
20140
|
-
else if (nextCharge &&
|
|
20141
|
-
charge.priceListChargeId === nextCharge.priceListChargeId &&
|
|
20142
|
-
(charge.endDate !== nextCharge.endDate ||
|
|
20143
|
-
charge.startDate !== nextCharge.startDate) &&
|
|
20144
|
-
charge.kind === nextCharge.kind &&
|
|
20145
|
-
(!isTrial || charge.trial) &&
|
|
20146
|
-
(isTrial || !charge.trial)) {
|
|
20147
|
-
nextCharge.name = "";
|
|
20148
|
-
combinedSubscriptionCharges.push(aggregationCharge);
|
|
20149
|
-
aggregationCharge = undefined;
|
|
20150
|
-
}
|
|
20151
|
-
else {
|
|
20152
|
-
combinedSubscriptionCharges.push(aggregationCharge);
|
|
20153
|
-
aggregationCharge = undefined;
|
|
20154
|
-
}
|
|
20155
|
-
}
|
|
20156
|
-
subscription.charges = combinedSubscriptionCharges;
|
|
20157
|
-
return subscription;
|
|
20158
|
-
});
|
|
20159
|
-
var subscriptionOrder = Object.values(SubscriptionState$2);
|
|
20160
|
-
combinedSubscriptions === null || combinedSubscriptions === void 0 ? void 0 : combinedSubscriptions.sort(function (a, b) {
|
|
20161
|
-
return subscriptionOrder.indexOf(a.state) - subscriptionOrder.indexOf(b.state);
|
|
20162
|
-
});
|
|
20163
|
-
return combinedSubscriptions;
|
|
20164
|
-
}, [data]);
|
|
20165
|
-
};
|
|
20166
|
-
|
|
20167
20103
|
var ErrorView = function (_a) {
|
|
20168
20104
|
var children = _a.children, message = _a.message;
|
|
20169
20105
|
return (jsxs("div", __assign({ className: "flex flex-col w-full", style: { marginTop: "80px" } }, { children: [jsx("div", __assign({ style: { fontSize: "32px" } }, { children: message })), children] })));
|
|
@@ -20596,14 +20532,12 @@ var Subscriptions = function (_a) {
|
|
|
20596
20532
|
}),
|
|
20597
20533
|
queryFn: function () { return getSubscriptions({ entityId: entityId, token: token, apiHost: apiHost }); },
|
|
20598
20534
|
enabled: Boolean(entityId),
|
|
20599
|
-
}),
|
|
20535
|
+
}), subscriptions = _d.data, subscriptionsAreLoading = _d.isLoading;
|
|
20600
20536
|
var _e = useQuery({
|
|
20601
20537
|
queryKey: QueryKeyFactory.default.planChangeOptionsKey({ token: token }),
|
|
20602
20538
|
queryFn: function () { return getPlanChangeOptions({ token: token, apiHost: apiHost }); },
|
|
20603
20539
|
enabled: Boolean(onChangePlanClick),
|
|
20604
20540
|
}), planChangeOptions = _e.data, arePlanChangeOptionsLoading = _e.isLoading;
|
|
20605
|
-
// Derived state
|
|
20606
|
-
var subscriptions = useSubscriptions({ data: rawSubscriptions });
|
|
20607
20541
|
useEffect(function () {
|
|
20608
20542
|
if (subscriptions)
|
|
20609
20543
|
onSubscriptionsLoaded === null || onSubscriptionsLoaded === void 0 ? void 0 : onSubscriptionsLoaded(subscriptions);
|
package/dist/esm/src/components/Subscriptions/subscriptionsList/SubscriptionCardActions.d.ts
CHANGED
|
@@ -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?:
|
|
5
|
+
planChangeOptions?: any;
|
|
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?:
|
|
5
|
+
planChangeOptions?: any;
|
|
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?:
|
|
6
|
+
planChangeOptions?: any;
|
|
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?:
|
|
5
|
+
planChangeOptions?: any;
|
|
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.
|
|
3
|
+
"version": "1.0.43",
|
|
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",
|
|
@@ -63,7 +63,8 @@
|
|
|
63
63
|
"vite": "^6.2.1"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"@
|
|
66
|
+
"@ant-design/icons": "^5.6.1",
|
|
67
|
+
"@bunnyapp/common": "^1.0.52",
|
|
67
68
|
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
|
68
69
|
"@fortawesome/free-brands-svg-icons": "^6.7.2",
|
|
69
70
|
"@fortawesome/free-regular-svg-icons": "^6.7.2",
|
|
@@ -78,17 +79,19 @@
|
|
|
78
79
|
"interweave": "^13.1.0",
|
|
79
80
|
"less": "^4.2.0",
|
|
80
81
|
"lodash-es": "^4.17.21",
|
|
82
|
+
"pluralize": "^8.0.0",
|
|
81
83
|
"react": "^18.3.1",
|
|
82
84
|
"react-dom": "^18.3.1",
|
|
83
85
|
"recharts": "^2.15.0",
|
|
84
86
|
"recoil": "^0.7.7",
|
|
85
|
-
"
|
|
86
|
-
"styled-components": "^6.1.13",
|
|
87
|
-
"pluralize": "^8.0.0"
|
|
87
|
+
"styled-components": "^6.1.13"
|
|
88
88
|
},
|
|
89
89
|
"msw": {
|
|
90
90
|
"workerDirectory": [
|
|
91
91
|
"public"
|
|
92
92
|
]
|
|
93
|
+
},
|
|
94
|
+
"dependencies": {
|
|
95
|
+
"msw-storybook-addon": "^2.0.4"
|
|
93
96
|
}
|
|
94
97
|
}
|