@schematichq/schematic-components 2.36.1 → 2.37.0
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/schematic-components-elements.cjs.js +112 -36
- package/dist/schematic-components-elements.d.ts +10 -0
- package/dist/schematic-components-elements.esm.js +112 -36
- package/dist/schematic-components.browser.cjs.js +677 -393
- package/dist/schematic-components.browser.esm.js +677 -393
- package/dist/schematic-components.cjs.js +835 -539
- package/dist/schematic-components.d.ts +277 -73
- package/dist/schematic-components.esm.js +879 -583
- package/package.json +22 -22
|
@@ -3157,11 +3157,7 @@ function derivePricingTable(view, options) {
|
|
|
3157
3157
|
const { catalog } = view;
|
|
3158
3158
|
const plans = catalog.plans;
|
|
3159
3159
|
const addOns = catalog.addOns;
|
|
3160
|
-
const currencies = unique(
|
|
3161
|
-
[...plans, ...addOns].flatMap(
|
|
3162
|
-
(plan) => plan.currencyPrices.map((prices) => prices.currency.toLowerCase())
|
|
3163
|
-
)
|
|
3164
|
-
);
|
|
3160
|
+
const currencies = unique([...plans, ...addOns].flatMap(currenciesOf));
|
|
3165
3161
|
const defaultCurrency = catalog.defaultCurrency?.toLowerCase();
|
|
3166
3162
|
const currency = pick(currencies, options.currency?.toLowerCase(), [defaultCurrency]) ?? defaultCurrency ?? "usd";
|
|
3167
3163
|
const priced = (plan) => supportsCurrency(plan, currency);
|
|
@@ -3260,6 +3256,7 @@ function card(plan, context, role) {
|
|
|
3260
3256
|
const oneTime = isOneTime2(plan);
|
|
3261
3257
|
const period = oneTime || periodsOf(plan).length === 0 ? null : context.period;
|
|
3262
3258
|
const price = planPrice3(plan, currency, oneTime ? "oneTime" : period);
|
|
3259
|
+
const custom = customPlanOf2(plan);
|
|
3263
3260
|
const entitlements = plan.entitlements;
|
|
3264
3261
|
const amount = price === void 0 ? 0 : amountOf2(price);
|
|
3265
3262
|
const usageBased = entitlements.some(
|
|
@@ -3270,15 +3267,25 @@ function card(plan, context, role) {
|
|
|
3270
3267
|
);
|
|
3271
3268
|
const { current } = standing(plan);
|
|
3272
3269
|
const active = current && (period === null || context.currentPeriod === null || period === context.currentPeriod);
|
|
3270
|
+
let shownPrice;
|
|
3271
|
+
if (custom !== null) {
|
|
3272
|
+
shownPrice = { kind: "custom", text: custom.priceText };
|
|
3273
|
+
} else if (amount === 0 && usageBased) {
|
|
3274
|
+
shownPrice = { kind: "usageBased" };
|
|
3275
|
+
} else if (amount === 0 && options.showZeroPriceAsFree === true) {
|
|
3276
|
+
shownPrice = { kind: "free" };
|
|
3277
|
+
} else {
|
|
3278
|
+
shownPrice = {
|
|
3279
|
+
kind: "amount",
|
|
3280
|
+
amount: formatCurrency(amount, currency, locale),
|
|
3281
|
+
period
|
|
3282
|
+
};
|
|
3283
|
+
}
|
|
3273
3284
|
return {
|
|
3274
3285
|
id: plan.id,
|
|
3275
3286
|
name: plan.name,
|
|
3276
3287
|
description: nonEmpty2(plan.description),
|
|
3277
|
-
price:
|
|
3278
|
-
kind: "amount",
|
|
3279
|
-
amount: formatCurrency(amount, currency, locale),
|
|
3280
|
-
period
|
|
3281
|
-
},
|
|
3288
|
+
price: shownPrice,
|
|
3282
3289
|
priceId: price?.id ?? null,
|
|
3283
3290
|
period,
|
|
3284
3291
|
credits: options.showCredits === false ? [] : creditLines(grants, entitlements, locale),
|
|
@@ -3286,6 +3293,7 @@ function card(plan, context, role) {
|
|
|
3286
3293
|
(entitlement) => entitlementRow(entitlement, context, period, grants)
|
|
3287
3294
|
),
|
|
3288
3295
|
action: context.view.source === "public" ? null : action(plan, context, role, active),
|
|
3296
|
+
custom,
|
|
3289
3297
|
active,
|
|
3290
3298
|
trialDays: plan.isTrialable && typeof plan.trialDays === "number" ? plan.trialDays : null,
|
|
3291
3299
|
source: plan
|
|
@@ -3516,11 +3524,15 @@ function planPrice3(plan, currency, period) {
|
|
|
3516
3524
|
if (period === null) {
|
|
3517
3525
|
return void 0;
|
|
3518
3526
|
}
|
|
3519
|
-
const prices = plan.currencyPrices.find(
|
|
3520
|
-
(candidate) => candidate.currency.toLowerCase() === currency
|
|
3521
|
-
);
|
|
3522
3527
|
const key = PRICE_KEY[period];
|
|
3523
|
-
|
|
3528
|
+
if (plan.currencyPrices.length > 0) {
|
|
3529
|
+
const row = plan.currencyPrices.find(
|
|
3530
|
+
(candidate) => candidate.currency.toLowerCase() === currency
|
|
3531
|
+
);
|
|
3532
|
+
return row?.[key] ?? void 0;
|
|
3533
|
+
}
|
|
3534
|
+
const field = plan[key];
|
|
3535
|
+
return field !== void 0 && field.currency.toLowerCase() === currency ? field : void 0;
|
|
3524
3536
|
}
|
|
3525
3537
|
var PRICE_KEY = {
|
|
3526
3538
|
month: "monthlyPrice",
|
|
@@ -3562,11 +3574,34 @@ function periodsOf(plan) {
|
|
|
3562
3574
|
return period === void 0 ? [] : [period];
|
|
3563
3575
|
});
|
|
3564
3576
|
}
|
|
3565
|
-
function
|
|
3566
|
-
|
|
3567
|
-
|
|
3577
|
+
function currenciesOf(plan) {
|
|
3578
|
+
if (plan.currencyPrices.length > 0) {
|
|
3579
|
+
return unique(
|
|
3580
|
+
plan.currencyPrices.map((prices) => prices.currency.toLowerCase())
|
|
3581
|
+
);
|
|
3582
|
+
}
|
|
3583
|
+
return unique(
|
|
3584
|
+
Object.values(PRICE_KEY).flatMap((key) => {
|
|
3585
|
+
const field = plan[key];
|
|
3586
|
+
return field === void 0 ? [] : [field.currency.toLowerCase()];
|
|
3587
|
+
})
|
|
3568
3588
|
);
|
|
3569
3589
|
}
|
|
3590
|
+
function supportsCurrency(plan, currency) {
|
|
3591
|
+
const currencies = currenciesOf(plan);
|
|
3592
|
+
return currencies.length === 0 || currencies.includes(currency);
|
|
3593
|
+
}
|
|
3594
|
+
function customPlanOf2(plan) {
|
|
3595
|
+
if (!plan.custom) {
|
|
3596
|
+
return null;
|
|
3597
|
+
}
|
|
3598
|
+
const cta = plan.customPlanCta;
|
|
3599
|
+
return {
|
|
3600
|
+
priceText: nonEmpty2(cta?.priceText),
|
|
3601
|
+
ctaText: nonEmpty2(cta?.ctaText),
|
|
3602
|
+
ctaUrl: nonEmpty2(cta?.ctaUrl)
|
|
3603
|
+
};
|
|
3604
|
+
}
|
|
3570
3605
|
function asPeriod(value) {
|
|
3571
3606
|
return value === "month" || value === "quarter" || value === "year" ? value : null;
|
|
3572
3607
|
}
|
|
@@ -4821,7 +4856,7 @@ var dialogCss = `
|
|
|
4821
4856
|
}
|
|
4822
4857
|
`;
|
|
4823
4858
|
|
|
4824
|
-
// node_modules/.pnpm/@schematichq+schematic-icons@0.8.0_react-dom@19.3.
|
|
4859
|
+
// node_modules/.pnpm/@schematichq+schematic-icons@0.8.0_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/@schematichq/schematic-icons/dist/types.js
|
|
4825
4860
|
var iconsList = {
|
|
4826
4861
|
"workos": 61697,
|
|
4827
4862
|
"wind": 61698,
|
|
@@ -8331,6 +8366,7 @@ function PeriodToggle({
|
|
|
8331
8366
|
"button",
|
|
8332
8367
|
{
|
|
8333
8368
|
"aria-pressed": period === model.period.value,
|
|
8369
|
+
className: "schematic-toggle__option",
|
|
8334
8370
|
type: "button",
|
|
8335
8371
|
onClick: () => dispatch({ type: "period", period }),
|
|
8336
8372
|
children: periodName(period, t)
|
|
@@ -11322,7 +11358,8 @@ function Card2({
|
|
|
11322
11358
|
{
|
|
11323
11359
|
className: cx(
|
|
11324
11360
|
"schematic-card schematic-plan-card",
|
|
11325
|
-
card2.active && "schematic-plan-card--active"
|
|
11361
|
+
card2.active && "schematic-plan-card--active",
|
|
11362
|
+
card2.custom !== null && "schematic-plan-card--custom"
|
|
11326
11363
|
),
|
|
11327
11364
|
"data-plan-id": card2.id,
|
|
11328
11365
|
children: [
|
|
@@ -11387,13 +11424,25 @@ function Card2({
|
|
|
11387
11424
|
function Price3({ price, t }) {
|
|
11388
11425
|
const per = price.kind === "amount" && price.period !== null ? periodWord2(price.period, t) : void 0;
|
|
11389
11426
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "schematic-plan-card__price", children: [
|
|
11390
|
-
|
|
11427
|
+
priceText2(price, t),
|
|
11391
11428
|
per !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("sub", { className: "schematic-plan-card__period", children: [
|
|
11392
11429
|
"/",
|
|
11393
11430
|
per
|
|
11394
11431
|
] })
|
|
11395
11432
|
] });
|
|
11396
11433
|
}
|
|
11434
|
+
function priceText2(price, t) {
|
|
11435
|
+
switch (price.kind) {
|
|
11436
|
+
case "usageBased":
|
|
11437
|
+
return t("pricingTableUsageBased");
|
|
11438
|
+
case "free":
|
|
11439
|
+
return t("pricingTableFree");
|
|
11440
|
+
case "custom":
|
|
11441
|
+
return price.text ?? t("pricingTableCustomPrice");
|
|
11442
|
+
case "amount":
|
|
11443
|
+
return price.amount;
|
|
11444
|
+
}
|
|
11445
|
+
}
|
|
11397
11446
|
function CreditItem({
|
|
11398
11447
|
credit,
|
|
11399
11448
|
showIcon,
|
|
@@ -11541,27 +11590,29 @@ function Action({
|
|
|
11541
11590
|
t("pricingTableCurrentPlan")
|
|
11542
11591
|
] });
|
|
11543
11592
|
}
|
|
11544
|
-
if (
|
|
11545
|
-
const
|
|
11546
|
-
|
|
11547
|
-
|
|
11548
|
-
|
|
11593
|
+
if (card2.custom !== null) {
|
|
11594
|
+
const link = hostedLink(card2.custom.ctaUrl, shared);
|
|
11595
|
+
if (link === void 0 && shared.onSelectPlan === void 0) {
|
|
11596
|
+
return null;
|
|
11597
|
+
}
|
|
11598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
11599
|
+
CallToAction,
|
|
11549
11600
|
{
|
|
11550
|
-
className: "schematic-cta
|
|
11551
|
-
|
|
11552
|
-
|
|
11553
|
-
children: text
|
|
11601
|
+
className: "schematic-cta",
|
|
11602
|
+
link,
|
|
11603
|
+
text: card2.custom.ctaText ?? t("pricingTableTalkToSupport")
|
|
11554
11604
|
}
|
|
11555
|
-
)
|
|
11556
|
-
|
|
11605
|
+
);
|
|
11606
|
+
}
|
|
11607
|
+
if (action2.kind === "downgradeBlocked") {
|
|
11608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
11609
|
+
CallToAction,
|
|
11557
11610
|
{
|
|
11558
11611
|
className: "schematic-cta schematic-cta--outline",
|
|
11559
|
-
|
|
11560
|
-
|
|
11561
|
-
target: link.target,
|
|
11562
|
-
children: text
|
|
11612
|
+
link: hostedLink(action2.url, shared),
|
|
11613
|
+
text: action2.text ?? t("pricingTableTalkToSupport")
|
|
11563
11614
|
}
|
|
11564
|
-
)
|
|
11615
|
+
);
|
|
11565
11616
|
}
|
|
11566
11617
|
const select = () => shared.onSelectPlan?.({
|
|
11567
11618
|
kind,
|
|
@@ -11611,6 +11662,31 @@ function Action({
|
|
|
11611
11662
|
}) })
|
|
11612
11663
|
] });
|
|
11613
11664
|
}
|
|
11665
|
+
function hostedLink(url, shared) {
|
|
11666
|
+
if (url !== null) {
|
|
11667
|
+
return { href: url, target: "_blank" };
|
|
11668
|
+
}
|
|
11669
|
+
if (shared.callToActionUrl !== void 0) {
|
|
11670
|
+
return { href: shared.callToActionUrl, target: shared.callToActionTarget };
|
|
11671
|
+
}
|
|
11672
|
+
return void 0;
|
|
11673
|
+
}
|
|
11674
|
+
function CallToAction({
|
|
11675
|
+
className,
|
|
11676
|
+
link,
|
|
11677
|
+
text
|
|
11678
|
+
}) {
|
|
11679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "schematic-plan-card__action", children: link === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { className, disabled: true, type: "button", children: text }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
11680
|
+
"a",
|
|
11681
|
+
{
|
|
11682
|
+
className,
|
|
11683
|
+
href: link.href,
|
|
11684
|
+
rel: "noreferrer",
|
|
11685
|
+
target: link.target,
|
|
11686
|
+
children: text
|
|
11687
|
+
}
|
|
11688
|
+
) });
|
|
11689
|
+
}
|
|
11614
11690
|
function CustomPlanCard2({
|
|
11615
11691
|
customPlan,
|
|
11616
11692
|
shared
|
|
@@ -2219,6 +2219,11 @@ export declare interface PricingCard {
|
|
|
2219
2219
|
entitlements: PricingEntitlementRow[];
|
|
2220
2220
|
/** `null` in the public catalog, where there is no company. */
|
|
2221
2221
|
action: PricingAction | null;
|
|
2222
|
+
/**
|
|
2223
|
+
* The catalog's custom plan, sold by quote, whose call to action and price
|
|
2224
|
+
* text stand in for the card's action and price; `null` for every other card.
|
|
2225
|
+
*/
|
|
2226
|
+
custom: PricingCustomPlan | null;
|
|
2222
2227
|
/** The company's plan in the chosen period, for the card's outline. */
|
|
2223
2228
|
active: boolean;
|
|
2224
2229
|
trialDays: number | null;
|
|
@@ -2355,6 +2360,11 @@ export declare type PricingPrice =
|
|
|
2355
2360
|
/** Priced at zero, and billed by what it is used. */
|
|
2356
2361
|
| {
|
|
2357
2362
|
kind: "usageBased";
|
|
2363
|
+
}
|
|
2364
|
+
/** Sold by quote: the custom plan's price text, or "Custom price". */
|
|
2365
|
+
| {
|
|
2366
|
+
kind: "custom";
|
|
2367
|
+
text: string | null;
|
|
2358
2368
|
};
|
|
2359
2369
|
|
|
2360
2370
|
/** What a card's action does: `remove` and `change` are for a held add-on. */
|
|
@@ -3070,11 +3070,7 @@ function derivePricingTable(view, options) {
|
|
|
3070
3070
|
const { catalog } = view;
|
|
3071
3071
|
const plans = catalog.plans;
|
|
3072
3072
|
const addOns = catalog.addOns;
|
|
3073
|
-
const currencies = unique(
|
|
3074
|
-
[...plans, ...addOns].flatMap(
|
|
3075
|
-
(plan) => plan.currencyPrices.map((prices) => prices.currency.toLowerCase())
|
|
3076
|
-
)
|
|
3077
|
-
);
|
|
3073
|
+
const currencies = unique([...plans, ...addOns].flatMap(currenciesOf));
|
|
3078
3074
|
const defaultCurrency = catalog.defaultCurrency?.toLowerCase();
|
|
3079
3075
|
const currency = pick(currencies, options.currency?.toLowerCase(), [defaultCurrency]) ?? defaultCurrency ?? "usd";
|
|
3080
3076
|
const priced = (plan) => supportsCurrency(plan, currency);
|
|
@@ -3173,6 +3169,7 @@ function card(plan, context, role) {
|
|
|
3173
3169
|
const oneTime = isOneTime2(plan);
|
|
3174
3170
|
const period = oneTime || periodsOf(plan).length === 0 ? null : context.period;
|
|
3175
3171
|
const price = planPrice3(plan, currency, oneTime ? "oneTime" : period);
|
|
3172
|
+
const custom = customPlanOf2(plan);
|
|
3176
3173
|
const entitlements = plan.entitlements;
|
|
3177
3174
|
const amount = price === void 0 ? 0 : amountOf2(price);
|
|
3178
3175
|
const usageBased = entitlements.some(
|
|
@@ -3183,15 +3180,25 @@ function card(plan, context, role) {
|
|
|
3183
3180
|
);
|
|
3184
3181
|
const { current } = standing(plan);
|
|
3185
3182
|
const active = current && (period === null || context.currentPeriod === null || period === context.currentPeriod);
|
|
3183
|
+
let shownPrice;
|
|
3184
|
+
if (custom !== null) {
|
|
3185
|
+
shownPrice = { kind: "custom", text: custom.priceText };
|
|
3186
|
+
} else if (amount === 0 && usageBased) {
|
|
3187
|
+
shownPrice = { kind: "usageBased" };
|
|
3188
|
+
} else if (amount === 0 && options.showZeroPriceAsFree === true) {
|
|
3189
|
+
shownPrice = { kind: "free" };
|
|
3190
|
+
} else {
|
|
3191
|
+
shownPrice = {
|
|
3192
|
+
kind: "amount",
|
|
3193
|
+
amount: formatCurrency(amount, currency, locale),
|
|
3194
|
+
period
|
|
3195
|
+
};
|
|
3196
|
+
}
|
|
3186
3197
|
return {
|
|
3187
3198
|
id: plan.id,
|
|
3188
3199
|
name: plan.name,
|
|
3189
3200
|
description: nonEmpty2(plan.description),
|
|
3190
|
-
price:
|
|
3191
|
-
kind: "amount",
|
|
3192
|
-
amount: formatCurrency(amount, currency, locale),
|
|
3193
|
-
period
|
|
3194
|
-
},
|
|
3201
|
+
price: shownPrice,
|
|
3195
3202
|
priceId: price?.id ?? null,
|
|
3196
3203
|
period,
|
|
3197
3204
|
credits: options.showCredits === false ? [] : creditLines(grants, entitlements, locale),
|
|
@@ -3199,6 +3206,7 @@ function card(plan, context, role) {
|
|
|
3199
3206
|
(entitlement) => entitlementRow(entitlement, context, period, grants)
|
|
3200
3207
|
),
|
|
3201
3208
|
action: context.view.source === "public" ? null : action(plan, context, role, active),
|
|
3209
|
+
custom,
|
|
3202
3210
|
active,
|
|
3203
3211
|
trialDays: plan.isTrialable && typeof plan.trialDays === "number" ? plan.trialDays : null,
|
|
3204
3212
|
source: plan
|
|
@@ -3429,11 +3437,15 @@ function planPrice3(plan, currency, period) {
|
|
|
3429
3437
|
if (period === null) {
|
|
3430
3438
|
return void 0;
|
|
3431
3439
|
}
|
|
3432
|
-
const prices = plan.currencyPrices.find(
|
|
3433
|
-
(candidate) => candidate.currency.toLowerCase() === currency
|
|
3434
|
-
);
|
|
3435
3440
|
const key = PRICE_KEY[period];
|
|
3436
|
-
|
|
3441
|
+
if (plan.currencyPrices.length > 0) {
|
|
3442
|
+
const row = plan.currencyPrices.find(
|
|
3443
|
+
(candidate) => candidate.currency.toLowerCase() === currency
|
|
3444
|
+
);
|
|
3445
|
+
return row?.[key] ?? void 0;
|
|
3446
|
+
}
|
|
3447
|
+
const field = plan[key];
|
|
3448
|
+
return field !== void 0 && field.currency.toLowerCase() === currency ? field : void 0;
|
|
3437
3449
|
}
|
|
3438
3450
|
var PRICE_KEY = {
|
|
3439
3451
|
month: "monthlyPrice",
|
|
@@ -3475,11 +3487,34 @@ function periodsOf(plan) {
|
|
|
3475
3487
|
return period === void 0 ? [] : [period];
|
|
3476
3488
|
});
|
|
3477
3489
|
}
|
|
3478
|
-
function
|
|
3479
|
-
|
|
3480
|
-
|
|
3490
|
+
function currenciesOf(plan) {
|
|
3491
|
+
if (plan.currencyPrices.length > 0) {
|
|
3492
|
+
return unique(
|
|
3493
|
+
plan.currencyPrices.map((prices) => prices.currency.toLowerCase())
|
|
3494
|
+
);
|
|
3495
|
+
}
|
|
3496
|
+
return unique(
|
|
3497
|
+
Object.values(PRICE_KEY).flatMap((key) => {
|
|
3498
|
+
const field = plan[key];
|
|
3499
|
+
return field === void 0 ? [] : [field.currency.toLowerCase()];
|
|
3500
|
+
})
|
|
3481
3501
|
);
|
|
3482
3502
|
}
|
|
3503
|
+
function supportsCurrency(plan, currency) {
|
|
3504
|
+
const currencies = currenciesOf(plan);
|
|
3505
|
+
return currencies.length === 0 || currencies.includes(currency);
|
|
3506
|
+
}
|
|
3507
|
+
function customPlanOf2(plan) {
|
|
3508
|
+
if (!plan.custom) {
|
|
3509
|
+
return null;
|
|
3510
|
+
}
|
|
3511
|
+
const cta = plan.customPlanCta;
|
|
3512
|
+
return {
|
|
3513
|
+
priceText: nonEmpty2(cta?.priceText),
|
|
3514
|
+
ctaText: nonEmpty2(cta?.ctaText),
|
|
3515
|
+
ctaUrl: nonEmpty2(cta?.ctaUrl)
|
|
3516
|
+
};
|
|
3517
|
+
}
|
|
3483
3518
|
function asPeriod(value) {
|
|
3484
3519
|
return value === "month" || value === "quarter" || value === "year" ? value : null;
|
|
3485
3520
|
}
|
|
@@ -4734,7 +4769,7 @@ var dialogCss = `
|
|
|
4734
4769
|
}
|
|
4735
4770
|
`;
|
|
4736
4771
|
|
|
4737
|
-
// node_modules/.pnpm/@schematichq+schematic-icons@0.8.0_react-dom@19.3.
|
|
4772
|
+
// node_modules/.pnpm/@schematichq+schematic-icons@0.8.0_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/@schematichq/schematic-icons/dist/types.js
|
|
4738
4773
|
var iconsList = {
|
|
4739
4774
|
"workos": 61697,
|
|
4740
4775
|
"wind": 61698,
|
|
@@ -8272,6 +8307,7 @@ function PeriodToggle({
|
|
|
8272
8307
|
"button",
|
|
8273
8308
|
{
|
|
8274
8309
|
"aria-pressed": period === model.period.value,
|
|
8310
|
+
className: "schematic-toggle__option",
|
|
8275
8311
|
type: "button",
|
|
8276
8312
|
onClick: () => dispatch({ type: "period", period }),
|
|
8277
8313
|
children: periodName(period, t)
|
|
@@ -11279,7 +11315,8 @@ function Card2({
|
|
|
11279
11315
|
{
|
|
11280
11316
|
className: cx(
|
|
11281
11317
|
"schematic-card schematic-plan-card",
|
|
11282
|
-
card2.active && "schematic-plan-card--active"
|
|
11318
|
+
card2.active && "schematic-plan-card--active",
|
|
11319
|
+
card2.custom !== null && "schematic-plan-card--custom"
|
|
11283
11320
|
),
|
|
11284
11321
|
"data-plan-id": card2.id,
|
|
11285
11322
|
children: [
|
|
@@ -11344,13 +11381,25 @@ function Card2({
|
|
|
11344
11381
|
function Price3({ price, t }) {
|
|
11345
11382
|
const per = price.kind === "amount" && price.period !== null ? periodWord2(price.period, t) : void 0;
|
|
11346
11383
|
return /* @__PURE__ */ jsxs16("div", { className: "schematic-plan-card__price", children: [
|
|
11347
|
-
|
|
11384
|
+
priceText2(price, t),
|
|
11348
11385
|
per !== void 0 && /* @__PURE__ */ jsxs16("sub", { className: "schematic-plan-card__period", children: [
|
|
11349
11386
|
"/",
|
|
11350
11387
|
per
|
|
11351
11388
|
] })
|
|
11352
11389
|
] });
|
|
11353
11390
|
}
|
|
11391
|
+
function priceText2(price, t) {
|
|
11392
|
+
switch (price.kind) {
|
|
11393
|
+
case "usageBased":
|
|
11394
|
+
return t("pricingTableUsageBased");
|
|
11395
|
+
case "free":
|
|
11396
|
+
return t("pricingTableFree");
|
|
11397
|
+
case "custom":
|
|
11398
|
+
return price.text ?? t("pricingTableCustomPrice");
|
|
11399
|
+
case "amount":
|
|
11400
|
+
return price.amount;
|
|
11401
|
+
}
|
|
11402
|
+
}
|
|
11354
11403
|
function CreditItem({
|
|
11355
11404
|
credit,
|
|
11356
11405
|
showIcon,
|
|
@@ -11498,27 +11547,29 @@ function Action({
|
|
|
11498
11547
|
t("pricingTableCurrentPlan")
|
|
11499
11548
|
] });
|
|
11500
11549
|
}
|
|
11501
|
-
if (
|
|
11502
|
-
const
|
|
11503
|
-
|
|
11504
|
-
|
|
11505
|
-
|
|
11550
|
+
if (card2.custom !== null) {
|
|
11551
|
+
const link = hostedLink(card2.custom.ctaUrl, shared);
|
|
11552
|
+
if (link === void 0 && shared.onSelectPlan === void 0) {
|
|
11553
|
+
return null;
|
|
11554
|
+
}
|
|
11555
|
+
return /* @__PURE__ */ jsx16(
|
|
11556
|
+
CallToAction,
|
|
11506
11557
|
{
|
|
11507
|
-
className: "schematic-cta
|
|
11508
|
-
|
|
11509
|
-
|
|
11510
|
-
children: text
|
|
11558
|
+
className: "schematic-cta",
|
|
11559
|
+
link,
|
|
11560
|
+
text: card2.custom.ctaText ?? t("pricingTableTalkToSupport")
|
|
11511
11561
|
}
|
|
11512
|
-
)
|
|
11513
|
-
|
|
11562
|
+
);
|
|
11563
|
+
}
|
|
11564
|
+
if (action2.kind === "downgradeBlocked") {
|
|
11565
|
+
return /* @__PURE__ */ jsx16(
|
|
11566
|
+
CallToAction,
|
|
11514
11567
|
{
|
|
11515
11568
|
className: "schematic-cta schematic-cta--outline",
|
|
11516
|
-
|
|
11517
|
-
|
|
11518
|
-
target: link.target,
|
|
11519
|
-
children: text
|
|
11569
|
+
link: hostedLink(action2.url, shared),
|
|
11570
|
+
text: action2.text ?? t("pricingTableTalkToSupport")
|
|
11520
11571
|
}
|
|
11521
|
-
)
|
|
11572
|
+
);
|
|
11522
11573
|
}
|
|
11523
11574
|
const select = () => shared.onSelectPlan?.({
|
|
11524
11575
|
kind,
|
|
@@ -11568,6 +11619,31 @@ function Action({
|
|
|
11568
11619
|
}) })
|
|
11569
11620
|
] });
|
|
11570
11621
|
}
|
|
11622
|
+
function hostedLink(url, shared) {
|
|
11623
|
+
if (url !== null) {
|
|
11624
|
+
return { href: url, target: "_blank" };
|
|
11625
|
+
}
|
|
11626
|
+
if (shared.callToActionUrl !== void 0) {
|
|
11627
|
+
return { href: shared.callToActionUrl, target: shared.callToActionTarget };
|
|
11628
|
+
}
|
|
11629
|
+
return void 0;
|
|
11630
|
+
}
|
|
11631
|
+
function CallToAction({
|
|
11632
|
+
className,
|
|
11633
|
+
link,
|
|
11634
|
+
text
|
|
11635
|
+
}) {
|
|
11636
|
+
return /* @__PURE__ */ jsx16("div", { className: "schematic-plan-card__action", children: link === void 0 ? /* @__PURE__ */ jsx16("button", { className, disabled: true, type: "button", children: text }) : /* @__PURE__ */ jsx16(
|
|
11637
|
+
"a",
|
|
11638
|
+
{
|
|
11639
|
+
className,
|
|
11640
|
+
href: link.href,
|
|
11641
|
+
rel: "noreferrer",
|
|
11642
|
+
target: link.target,
|
|
11643
|
+
children: text
|
|
11644
|
+
}
|
|
11645
|
+
) });
|
|
11646
|
+
}
|
|
11571
11647
|
function CustomPlanCard2({
|
|
11572
11648
|
customPlan,
|
|
11573
11649
|
shared
|