@bunnyapp/components 1.0.29 → 1.0.31
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 +13 -9
- package/dist/esm/index.js +14 -10
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -4604,9 +4604,11 @@ var SubscriptionChargeTotal = function (_a) {
|
|
|
4604
4604
|
var currencyId = subscription.currencyId;
|
|
4605
4605
|
var formattedDiscountedPrice = common.formatCurrency(charge.price, currencyId);
|
|
4606
4606
|
var formattedPeriodPrice = common.formatCurrency(charge.periodPrice, currencyId);
|
|
4607
|
-
return (jsxRuntime.jsx("div", __assign({ className: "flex gap-1 ".concat(isMobile ? "flex-col" : "") }, { children: charge.
|
|
4608
|
-
? "-"
|
|
4609
|
-
:
|
|
4607
|
+
return (jsxRuntime.jsx("div", __assign({ className: "flex gap-1 ".concat(isMobile ? "flex-col" : "") }, { children: charge.chargeType === common.ChargeType.USAGE || charge.trial
|
|
4608
|
+
? "-"
|
|
4609
|
+
: charge.kind === common.SubscriptionChargeKind.DISCOUNT
|
|
4610
|
+
? "-".concat(formattedDiscountedPrice, " ").concat(billingPeriod)
|
|
4611
|
+
: "".concat(formattedPeriodPrice, " ").concat(billingPeriod) })));
|
|
4610
4612
|
};
|
|
4611
4613
|
|
|
4612
4614
|
var SubscriptionChargeUnitPrice = function (_a) {
|
|
@@ -4617,19 +4619,21 @@ var SubscriptionChargeUnitPrice = function (_a) {
|
|
|
4617
4619
|
var isDiscount = (charge === null || charge === void 0 ? void 0 : charge.kind) === common.SubscriptionChargeKind.DISCOUNT;
|
|
4618
4620
|
if (displayPriceTiers)
|
|
4619
4621
|
return (jsxRuntime.jsx(antd.Dropdown, __assign({ dropdownRender: function () {
|
|
4620
|
-
var _a
|
|
4622
|
+
var _a;
|
|
4621
4623
|
return (jsxRuntime.jsx("div", __assign({ className: "flex flex-col rounded border border-solid border-slate-200 p-2", style: {
|
|
4622
4624
|
backgroundColor: darkMode
|
|
4623
4625
|
? "var(--row-background-dark)"
|
|
4624
4626
|
: "var(--row-background)",
|
|
4625
|
-
} }, { children: jsxRuntime.jsx("div", __assign({ className: "grid grid-cols-2", style: { columnGap: "0.5rem" } }, { children: (
|
|
4626
|
-
var _a, _b, _c
|
|
4627
|
-
var ends = ((
|
|
4628
|
-
? ((
|
|
4627
|
+
} }, { children: jsxRuntime.jsx("div", __assign({ className: "grid grid-cols-2", style: { columnGap: "0.5rem" } }, { children: (_a = charge.priceTiers) === null || _a === void 0 ? void 0 : _a.map(function (tier, index) {
|
|
4628
|
+
var _a, _b, _c;
|
|
4629
|
+
var ends = ((_b = (_a = charge.priceTiers) === null || _a === void 0 ? void 0 : _a[index + 1]) === null || _b === void 0 ? void 0 : _b.starts)
|
|
4630
|
+
? ((_c = charge.priceTiers[index + 1]) === null || _c === void 0 ? void 0 : _c.starts) - 1
|
|
4629
4631
|
: "∞";
|
|
4630
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "contents" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "whitespace-nowrap" }, { children: [tier.starts.toLocaleString(), " - ", ends.toLocaleString(), "
|
|
4632
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "contents" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "whitespace-nowrap" }, { children: [tier.starts.toLocaleString(), " - ", ends.toLocaleString(), " :"] })), jsxRuntime.jsx("div", __assign({ className: "whitespace-nowrap text-right" }, { children: common.formatCurrency(tier.price, subscription.currencyId, charge.priceDecimals) }))] }), index));
|
|
4631
4633
|
}) })) })));
|
|
4632
4634
|
}, onOpenChange: setShowPriceTiers, open: showPriceTiers, trigger: ["click"] }, { children: jsxRuntime.jsx("div", __assign({ className: "cursor-pointer underline", onClick: function () { return setShowPriceTiers(!showPriceTiers); } }, { children: showPriceTiers ? "Hide tiers" : "Show tiers" })) })));
|
|
4635
|
+
else if (charge.chargeType === common.ChargeType.USAGE || charge.trial)
|
|
4636
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: "-" });
|
|
4633
4637
|
else if (isDiscount)
|
|
4634
4638
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: ["-", common.formatCurrency(charge.discountedPrice, subscription.currencyId)] }));
|
|
4635
4639
|
else
|
package/dist/esm/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import React__default, { createContext, useContext, useEffect, useState, useMemo
|
|
|
4
4
|
import { Markup } from 'interweave';
|
|
5
5
|
import { ConfigProvider, Button, Typography, Tag, Divider, Popconfirm, Input, Checkbox, Collapse, Modal, Form, Drawer, Card as Card$1, Select, Image, Dropdown, Skeleton } from 'antd';
|
|
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, SubscriptionChargeKind, SubscriptionState as SubscriptionState$2, MODAL_MAX_HEIGHT, SLATE_500, StringUtils, DataInterval, TAG_COLORS,
|
|
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, SubscriptionChargeKind, SubscriptionState as SubscriptionState$2, MODAL_MAX_HEIGHT, SLATE_500, StringUtils, DataInterval, TAG_COLORS, ChargeType, 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';
|
|
10
10
|
import { RecoilRoot } from 'recoil';
|
|
@@ -4576,9 +4576,11 @@ var SubscriptionChargeTotal = function (_a) {
|
|
|
4576
4576
|
var currencyId = subscription.currencyId;
|
|
4577
4577
|
var formattedDiscountedPrice = formatCurrency(charge.price, currencyId);
|
|
4578
4578
|
var formattedPeriodPrice = formatCurrency(charge.periodPrice, currencyId);
|
|
4579
|
-
return (jsx("div", __assign({ className: "flex gap-1 ".concat(isMobile ? "flex-col" : "") }, { children: charge.
|
|
4580
|
-
? "-"
|
|
4581
|
-
:
|
|
4579
|
+
return (jsx("div", __assign({ className: "flex gap-1 ".concat(isMobile ? "flex-col" : "") }, { children: charge.chargeType === ChargeType.USAGE || charge.trial
|
|
4580
|
+
? "-"
|
|
4581
|
+
: charge.kind === SubscriptionChargeKind.DISCOUNT
|
|
4582
|
+
? "-".concat(formattedDiscountedPrice, " ").concat(billingPeriod)
|
|
4583
|
+
: "".concat(formattedPeriodPrice, " ").concat(billingPeriod) })));
|
|
4582
4584
|
};
|
|
4583
4585
|
|
|
4584
4586
|
var SubscriptionChargeUnitPrice = function (_a) {
|
|
@@ -4589,19 +4591,21 @@ var SubscriptionChargeUnitPrice = function (_a) {
|
|
|
4589
4591
|
var isDiscount = (charge === null || charge === void 0 ? void 0 : charge.kind) === SubscriptionChargeKind.DISCOUNT;
|
|
4590
4592
|
if (displayPriceTiers)
|
|
4591
4593
|
return (jsx(Dropdown, __assign({ dropdownRender: function () {
|
|
4592
|
-
var _a
|
|
4594
|
+
var _a;
|
|
4593
4595
|
return (jsx("div", __assign({ className: "flex flex-col rounded border border-solid border-slate-200 p-2", style: {
|
|
4594
4596
|
backgroundColor: darkMode
|
|
4595
4597
|
? "var(--row-background-dark)"
|
|
4596
4598
|
: "var(--row-background)",
|
|
4597
|
-
} }, { children: jsx("div", __assign({ className: "grid grid-cols-2", style: { columnGap: "0.5rem" } }, { children: (
|
|
4598
|
-
var _a, _b, _c
|
|
4599
|
-
var ends = ((
|
|
4600
|
-
? ((
|
|
4599
|
+
} }, { children: jsx("div", __assign({ className: "grid grid-cols-2", style: { columnGap: "0.5rem" } }, { children: (_a = charge.priceTiers) === null || _a === void 0 ? void 0 : _a.map(function (tier, index) {
|
|
4600
|
+
var _a, _b, _c;
|
|
4601
|
+
var ends = ((_b = (_a = charge.priceTiers) === null || _a === void 0 ? void 0 : _a[index + 1]) === null || _b === void 0 ? void 0 : _b.starts)
|
|
4602
|
+
? ((_c = charge.priceTiers[index + 1]) === null || _c === void 0 ? void 0 : _c.starts) - 1
|
|
4601
4603
|
: "∞";
|
|
4602
|
-
return (jsxs("div", __assign({ className: "contents" }, { children: [jsxs("div", __assign({ className: "whitespace-nowrap" }, { children: [tier.starts.toLocaleString(), " - ", ends.toLocaleString(), "
|
|
4604
|
+
return (jsxs("div", __assign({ className: "contents" }, { children: [jsxs("div", __assign({ className: "whitespace-nowrap" }, { children: [tier.starts.toLocaleString(), " - ", ends.toLocaleString(), " :"] })), jsx("div", __assign({ className: "whitespace-nowrap text-right" }, { children: formatCurrency(tier.price, subscription.currencyId, charge.priceDecimals) }))] }), index));
|
|
4603
4605
|
}) })) })));
|
|
4604
4606
|
}, onOpenChange: setShowPriceTiers, open: showPriceTiers, trigger: ["click"] }, { children: jsx("div", __assign({ className: "cursor-pointer underline", onClick: function () { return setShowPriceTiers(!showPriceTiers); } }, { children: showPriceTiers ? "Hide tiers" : "Show tiers" })) })));
|
|
4607
|
+
else if (charge.chargeType === ChargeType.USAGE || charge.trial)
|
|
4608
|
+
return jsx(Fragment, { children: "-" });
|
|
4605
4609
|
else if (isDiscount)
|
|
4606
4610
|
return (jsxs(Fragment, { children: ["-", formatCurrency(charge.discountedPrice, subscription.currencyId)] }));
|
|
4607
4611
|
else
|
package/package.json
CHANGED