@bunnyapp/components 1.7.0-beta.42 → 1.7.0-beta.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/dist/cjs/index.js +34 -31
- package/dist/cjs/types/src/components/Signup/PriceListDisplay.d.ts +1 -0
- package/dist/cjs/types/src/utils/pricePickerUtils.d.ts +1 -1
- package/dist/esm/index.js +34 -31
- package/dist/esm/types/src/components/Signup/PriceListDisplay.d.ts +1 -0
- package/dist/esm/types/src/utils/pricePickerUtils.d.ts +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -1283,7 +1283,7 @@ const DEFAULT_CONFIG = {
|
|
|
1283
1283
|
};
|
|
1284
1284
|
|
|
1285
1285
|
// This will be replaced at build time by rollup-plugin-replace
|
|
1286
|
-
const PACKAGE_VERSION = '1.7.0-beta.
|
|
1286
|
+
const PACKAGE_VERSION = '1.7.0-beta.42';
|
|
1287
1287
|
const createRequestHeaders = (token) => {
|
|
1288
1288
|
const headers = createClientDevHeaders({ token });
|
|
1289
1289
|
// Add the components version header
|
|
@@ -23314,6 +23314,35 @@ const TAG_COLORS = {
|
|
|
23314
23314
|
PENDING: 'yellow',
|
|
23315
23315
|
};
|
|
23316
23316
|
|
|
23317
|
+
const graphql = initGraphQLTada();
|
|
23318
|
+
|
|
23319
|
+
const periodMonthsConverter = (period) => {
|
|
23320
|
+
if (period === 0)
|
|
23321
|
+
return graphql.scalar('BillingPeriod', 'ONCE');
|
|
23322
|
+
else if (period === 1)
|
|
23323
|
+
return graphql.scalar('BillingPeriod', 'MONTHLY');
|
|
23324
|
+
else if (period === 3)
|
|
23325
|
+
return graphql.scalar('BillingPeriod', 'QUARTERLY');
|
|
23326
|
+
else if (period === 6)
|
|
23327
|
+
return graphql.scalar('BillingPeriod', 'SEMI_ANNUAL');
|
|
23328
|
+
else if (period === 12)
|
|
23329
|
+
return graphql.scalar('BillingPeriod', 'ANNUAL');
|
|
23330
|
+
else
|
|
23331
|
+
return null;
|
|
23332
|
+
};
|
|
23333
|
+
const billingPeriodConverter = (period) => {
|
|
23334
|
+
if (period === graphql.scalar('BillingPeriod', 'ONCE'))
|
|
23335
|
+
return 0;
|
|
23336
|
+
else if (period === graphql.scalar('BillingPeriod', 'MONTHLY'))
|
|
23337
|
+
return 1;
|
|
23338
|
+
else if (period === graphql.scalar('BillingPeriod', 'QUARTERLY'))
|
|
23339
|
+
return 3;
|
|
23340
|
+
else if (period === graphql.scalar('BillingPeriod', 'SEMI_ANNUAL'))
|
|
23341
|
+
return 6;
|
|
23342
|
+
else
|
|
23343
|
+
return 12;
|
|
23344
|
+
};
|
|
23345
|
+
|
|
23317
23346
|
const { Text: Text$p } = antd.Typography;
|
|
23318
23347
|
const PriceListDisplay_PriceListFragment = t(`
|
|
23319
23348
|
fragment PriceListDisplay_PriceListFragment on PriceList {
|
|
@@ -23325,14 +23354,17 @@ const PriceListDisplay_PriceListFragment = t(`
|
|
|
23325
23354
|
currencyId
|
|
23326
23355
|
trialAllowed
|
|
23327
23356
|
trialLengthDays
|
|
23357
|
+
periodMonths
|
|
23328
23358
|
}
|
|
23329
23359
|
`);
|
|
23330
23360
|
function PriceListDisplay({ priceList: maskedPriceList }) {
|
|
23331
23361
|
var _a, _b;
|
|
23332
23362
|
const priceList = readFragment(PriceListDisplay_PriceListFragment, maskedPriceList);
|
|
23363
|
+
const convertedPeriodMonths = periodMonthsConverter(priceList === null || priceList === void 0 ? void 0 : priceList.periodMonths);
|
|
23364
|
+
const periodLabel = convertedPeriodMonths ? PERIOD_LABELS[convertedPeriodMonths] : 'undefined';
|
|
23333
23365
|
if (!priceList)
|
|
23334
23366
|
return null;
|
|
23335
|
-
return (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-4", children: [jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-0", children: [jsxRuntime.jsxs(Text$p, { className: "bunny-text-slate-500 bunny-font-bold bunny-text-lg", children: [(_a = priceList.product) === null || _a === void 0 ? void 0 : _a.name, " ", priceList.name] }), jsxRuntime.jsxs(Text$p, { className: "bunny-font-bold bunny-text-xl", children: [formatCurrency(priceList.basePrice, priceList.currencyId), " /
|
|
23367
|
+
return (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-4", children: [jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-0", children: [jsxRuntime.jsxs(Text$p, { className: "bunny-text-slate-500 bunny-font-bold bunny-text-lg", children: [(_a = priceList.product) === null || _a === void 0 ? void 0 : _a.name, " ", priceList.name] }), jsxRuntime.jsxs(Text$p, { className: "bunny-font-bold bunny-text-xl", children: [formatCurrency(priceList.basePrice, priceList.currencyId), " / ", periodLabel] })] }), priceList.trialAllowed ? (jsxRuntime.jsx("div", { className: "bunny-flex", children: jsxRuntime.jsx(CustomizedTag, { color: TAG_COLORS["TRIAL"], children: `${(_b = priceList.trialLengthDays) !== null && _b !== void 0 ? _b : 'N/A'} day trial` }) })) : null] }));
|
|
23336
23368
|
}
|
|
23337
23369
|
|
|
23338
23370
|
const Signup_PriceListFragment = t(`
|
|
@@ -23351,8 +23383,6 @@ const Signup_PriceListFragment = t(`
|
|
|
23351
23383
|
SelfServiceBuyWarning_PriceListFragment,
|
|
23352
23384
|
]);
|
|
23353
23385
|
|
|
23354
|
-
const graphql = initGraphQLTada();
|
|
23355
|
-
|
|
23356
23386
|
const mutation$g = graphql(`
|
|
23357
23387
|
mutation AccountSignup (
|
|
23358
23388
|
$pluginId: String!,
|
|
@@ -24168,33 +24198,6 @@ const CheckoutButton = ({ disabled, onClickCheckout, loading, tooltipText, }) =>
|
|
|
24168
24198
|
return (jsxRuntime.jsx(TooltipWrapper, { children: jsxRuntime.jsx(antd.Button, { className: isMobile ? 'w-full' : '', disabled: disabled, onClick: onClickCheckout, size: isMobile ? 'large' : 'middle', type: "primary", loading: loading, children: "Proceed to checkout" }) }));
|
|
24169
24199
|
};
|
|
24170
24200
|
|
|
24171
|
-
const periodMonthsConverter = (period) => {
|
|
24172
|
-
if (period === 0)
|
|
24173
|
-
return graphql.scalar('BillingPeriod', 'ONCE');
|
|
24174
|
-
else if (period === 1)
|
|
24175
|
-
return graphql.scalar('BillingPeriod', 'MONTHLY');
|
|
24176
|
-
else if (period === 3)
|
|
24177
|
-
return graphql.scalar('BillingPeriod', 'QUARTERLY');
|
|
24178
|
-
else if (period === 6)
|
|
24179
|
-
return graphql.scalar('BillingPeriod', 'SEMI_ANNUAL');
|
|
24180
|
-
else if (period === 12)
|
|
24181
|
-
return graphql.scalar('BillingPeriod', 'ANNUAL');
|
|
24182
|
-
else
|
|
24183
|
-
return null;
|
|
24184
|
-
};
|
|
24185
|
-
const billingPeriodConverter = (period) => {
|
|
24186
|
-
if (period === graphql.scalar('BillingPeriod', 'ONCE'))
|
|
24187
|
-
return 0;
|
|
24188
|
-
else if (period === graphql.scalar('BillingPeriod', 'MONTHLY'))
|
|
24189
|
-
return 1;
|
|
24190
|
-
else if (period === graphql.scalar('BillingPeriod', 'QUARTERLY'))
|
|
24191
|
-
return 3;
|
|
24192
|
-
else if (period === graphql.scalar('BillingPeriod', 'SEMI_ANNUAL'))
|
|
24193
|
-
return 6;
|
|
24194
|
-
else
|
|
24195
|
-
return 12;
|
|
24196
|
-
};
|
|
24197
|
-
|
|
24198
24201
|
const CheckoutPrice_QuoteFragment = t(`
|
|
24199
24202
|
fragment CheckoutPrice_QuoteFragment on Quote {
|
|
24200
24203
|
periodAmount
|
|
@@ -8,6 +8,7 @@ export declare const PriceListDisplay_PriceListFragment: import("gql.tada").Tada
|
|
|
8
8
|
currencyId: string;
|
|
9
9
|
trialAllowed: boolean;
|
|
10
10
|
trialLengthDays: number | null;
|
|
11
|
+
periodMonths: number | null;
|
|
11
12
|
}, {}, {
|
|
12
13
|
fragment: "PriceListDisplay_PriceListFragment";
|
|
13
14
|
on: "PriceList";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BillingPeriod } from '@/graphql-codegen/exportedScalarTypes';
|
|
2
2
|
import { Plan } from '@/types/Plan';
|
|
3
3
|
import Product from '@/types/Product';
|
|
4
|
-
export declare const periodMonthsConverter: (period: number | null) => "MONTHLY" | "QUARTERLY" | "SEMI_ANNUAL" | "ANNUAL" | "ONCE" | null;
|
|
4
|
+
export declare const periodMonthsConverter: (period: number | undefined | null) => "MONTHLY" | "QUARTERLY" | "SEMI_ANNUAL" | "ANNUAL" | "ONCE" | null;
|
|
5
5
|
export declare const billingPeriodConverter: (period?: BillingPeriod) => 3 | 0 | 1 | 6 | 12;
|
|
6
6
|
export declare const createAvailableBillingPeriods: (plans?: Plan[], selectedProduct?: Product) => (0 | 1 | 3 | 6 | 12)[] | undefined;
|
package/dist/esm/index.js
CHANGED
|
@@ -1281,7 +1281,7 @@ const DEFAULT_CONFIG = {
|
|
|
1281
1281
|
};
|
|
1282
1282
|
|
|
1283
1283
|
// This will be replaced at build time by rollup-plugin-replace
|
|
1284
|
-
const PACKAGE_VERSION = '1.7.0-beta.
|
|
1284
|
+
const PACKAGE_VERSION = '1.7.0-beta.42';
|
|
1285
1285
|
const createRequestHeaders = (token) => {
|
|
1286
1286
|
const headers = createClientDevHeaders({ token });
|
|
1287
1287
|
// Add the components version header
|
|
@@ -23312,6 +23312,35 @@ const TAG_COLORS = {
|
|
|
23312
23312
|
PENDING: 'yellow',
|
|
23313
23313
|
};
|
|
23314
23314
|
|
|
23315
|
+
const graphql = initGraphQLTada();
|
|
23316
|
+
|
|
23317
|
+
const periodMonthsConverter = (period) => {
|
|
23318
|
+
if (period === 0)
|
|
23319
|
+
return graphql.scalar('BillingPeriod', 'ONCE');
|
|
23320
|
+
else if (period === 1)
|
|
23321
|
+
return graphql.scalar('BillingPeriod', 'MONTHLY');
|
|
23322
|
+
else if (period === 3)
|
|
23323
|
+
return graphql.scalar('BillingPeriod', 'QUARTERLY');
|
|
23324
|
+
else if (period === 6)
|
|
23325
|
+
return graphql.scalar('BillingPeriod', 'SEMI_ANNUAL');
|
|
23326
|
+
else if (period === 12)
|
|
23327
|
+
return graphql.scalar('BillingPeriod', 'ANNUAL');
|
|
23328
|
+
else
|
|
23329
|
+
return null;
|
|
23330
|
+
};
|
|
23331
|
+
const billingPeriodConverter = (period) => {
|
|
23332
|
+
if (period === graphql.scalar('BillingPeriod', 'ONCE'))
|
|
23333
|
+
return 0;
|
|
23334
|
+
else if (period === graphql.scalar('BillingPeriod', 'MONTHLY'))
|
|
23335
|
+
return 1;
|
|
23336
|
+
else if (period === graphql.scalar('BillingPeriod', 'QUARTERLY'))
|
|
23337
|
+
return 3;
|
|
23338
|
+
else if (period === graphql.scalar('BillingPeriod', 'SEMI_ANNUAL'))
|
|
23339
|
+
return 6;
|
|
23340
|
+
else
|
|
23341
|
+
return 12;
|
|
23342
|
+
};
|
|
23343
|
+
|
|
23315
23344
|
const { Text: Text$p } = Typography;
|
|
23316
23345
|
const PriceListDisplay_PriceListFragment = t(`
|
|
23317
23346
|
fragment PriceListDisplay_PriceListFragment on PriceList {
|
|
@@ -23323,14 +23352,17 @@ const PriceListDisplay_PriceListFragment = t(`
|
|
|
23323
23352
|
currencyId
|
|
23324
23353
|
trialAllowed
|
|
23325
23354
|
trialLengthDays
|
|
23355
|
+
periodMonths
|
|
23326
23356
|
}
|
|
23327
23357
|
`);
|
|
23328
23358
|
function PriceListDisplay({ priceList: maskedPriceList }) {
|
|
23329
23359
|
var _a, _b;
|
|
23330
23360
|
const priceList = readFragment(PriceListDisplay_PriceListFragment, maskedPriceList);
|
|
23361
|
+
const convertedPeriodMonths = periodMonthsConverter(priceList === null || priceList === void 0 ? void 0 : priceList.periodMonths);
|
|
23362
|
+
const periodLabel = convertedPeriodMonths ? PERIOD_LABELS[convertedPeriodMonths] : 'undefined';
|
|
23331
23363
|
if (!priceList)
|
|
23332
23364
|
return null;
|
|
23333
|
-
return (jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-4", children: [jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-0", children: [jsxs(Text$p, { className: "bunny-text-slate-500 bunny-font-bold bunny-text-lg", children: [(_a = priceList.product) === null || _a === void 0 ? void 0 : _a.name, " ", priceList.name] }), jsxs(Text$p, { className: "bunny-font-bold bunny-text-xl", children: [formatCurrency(priceList.basePrice, priceList.currencyId), " /
|
|
23365
|
+
return (jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-4", children: [jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-0", children: [jsxs(Text$p, { className: "bunny-text-slate-500 bunny-font-bold bunny-text-lg", children: [(_a = priceList.product) === null || _a === void 0 ? void 0 : _a.name, " ", priceList.name] }), jsxs(Text$p, { className: "bunny-font-bold bunny-text-xl", children: [formatCurrency(priceList.basePrice, priceList.currencyId), " / ", periodLabel] })] }), priceList.trialAllowed ? (jsx("div", { className: "bunny-flex", children: jsx(CustomizedTag, { color: TAG_COLORS["TRIAL"], children: `${(_b = priceList.trialLengthDays) !== null && _b !== void 0 ? _b : 'N/A'} day trial` }) })) : null] }));
|
|
23334
23366
|
}
|
|
23335
23367
|
|
|
23336
23368
|
const Signup_PriceListFragment = t(`
|
|
@@ -23349,8 +23381,6 @@ const Signup_PriceListFragment = t(`
|
|
|
23349
23381
|
SelfServiceBuyWarning_PriceListFragment,
|
|
23350
23382
|
]);
|
|
23351
23383
|
|
|
23352
|
-
const graphql = initGraphQLTada();
|
|
23353
|
-
|
|
23354
23384
|
const mutation$g = graphql(`
|
|
23355
23385
|
mutation AccountSignup (
|
|
23356
23386
|
$pluginId: String!,
|
|
@@ -24166,33 +24196,6 @@ const CheckoutButton = ({ disabled, onClickCheckout, loading, tooltipText, }) =>
|
|
|
24166
24196
|
return (jsx(TooltipWrapper, { children: jsx(Button, { className: isMobile ? 'w-full' : '', disabled: disabled, onClick: onClickCheckout, size: isMobile ? 'large' : 'middle', type: "primary", loading: loading, children: "Proceed to checkout" }) }));
|
|
24167
24197
|
};
|
|
24168
24198
|
|
|
24169
|
-
const periodMonthsConverter = (period) => {
|
|
24170
|
-
if (period === 0)
|
|
24171
|
-
return graphql.scalar('BillingPeriod', 'ONCE');
|
|
24172
|
-
else if (period === 1)
|
|
24173
|
-
return graphql.scalar('BillingPeriod', 'MONTHLY');
|
|
24174
|
-
else if (period === 3)
|
|
24175
|
-
return graphql.scalar('BillingPeriod', 'QUARTERLY');
|
|
24176
|
-
else if (period === 6)
|
|
24177
|
-
return graphql.scalar('BillingPeriod', 'SEMI_ANNUAL');
|
|
24178
|
-
else if (period === 12)
|
|
24179
|
-
return graphql.scalar('BillingPeriod', 'ANNUAL');
|
|
24180
|
-
else
|
|
24181
|
-
return null;
|
|
24182
|
-
};
|
|
24183
|
-
const billingPeriodConverter = (period) => {
|
|
24184
|
-
if (period === graphql.scalar('BillingPeriod', 'ONCE'))
|
|
24185
|
-
return 0;
|
|
24186
|
-
else if (period === graphql.scalar('BillingPeriod', 'MONTHLY'))
|
|
24187
|
-
return 1;
|
|
24188
|
-
else if (period === graphql.scalar('BillingPeriod', 'QUARTERLY'))
|
|
24189
|
-
return 3;
|
|
24190
|
-
else if (period === graphql.scalar('BillingPeriod', 'SEMI_ANNUAL'))
|
|
24191
|
-
return 6;
|
|
24192
|
-
else
|
|
24193
|
-
return 12;
|
|
24194
|
-
};
|
|
24195
|
-
|
|
24196
24199
|
const CheckoutPrice_QuoteFragment = t(`
|
|
24197
24200
|
fragment CheckoutPrice_QuoteFragment on Quote {
|
|
24198
24201
|
periodAmount
|
|
@@ -8,6 +8,7 @@ export declare const PriceListDisplay_PriceListFragment: import("gql.tada").Tada
|
|
|
8
8
|
currencyId: string;
|
|
9
9
|
trialAllowed: boolean;
|
|
10
10
|
trialLengthDays: number | null;
|
|
11
|
+
periodMonths: number | null;
|
|
11
12
|
}, {}, {
|
|
12
13
|
fragment: "PriceListDisplay_PriceListFragment";
|
|
13
14
|
on: "PriceList";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BillingPeriod } from '@/graphql-codegen/exportedScalarTypes';
|
|
2
2
|
import { Plan } from '@/types/Plan';
|
|
3
3
|
import Product from '@/types/Product';
|
|
4
|
-
export declare const periodMonthsConverter: (period: number | null) => "MONTHLY" | "QUARTERLY" | "SEMI_ANNUAL" | "ANNUAL" | "ONCE" | null;
|
|
4
|
+
export declare const periodMonthsConverter: (period: number | undefined | null) => "MONTHLY" | "QUARTERLY" | "SEMI_ANNUAL" | "ANNUAL" | "ONCE" | null;
|
|
5
5
|
export declare const billingPeriodConverter: (period?: BillingPeriod) => 3 | 0 | 1 | 6 | 12;
|
|
6
6
|
export declare const createAvailableBillingPeriods: (plans?: Plan[], selectedProduct?: Product) => (0 | 1 | 3 | 6 | 12)[] | undefined;
|
package/package.json
CHANGED