@aforoai/storefront-widgets 1.0.5 → 1.0.6
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/CHANGELOG.md +18 -0
- package/dist/index.cjs +21 -11
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +21 -11
- package/dist/loader.js +1 -1
- package/dist/loader.mjs +1 -1
- package/dist/sri.json +11 -11
- package/dist/vanilla/index.cjs +23 -11
- package/dist/vanilla/index.mjs +23 -11
- package/dist/vue/index.cjs +23 -11
- package/dist/vue/index.mjs +23 -11
- package/dist/widgets/checkout-flow.js +5 -5
- package/dist/widgets/invoice-list.js +1 -1
- package/dist/widgets/payment-method.js +1 -1
- package/dist/widgets/pricing-card.js +8 -8
- package/dist/widgets/subscribe-button.js +1 -1
- package/dist/widgets/subscription-manager.js +1 -1
- package/dist/widgets/upgrade-cancel.js +5 -5
- package/dist/widgets/usage-meter.js +5 -5
- package/loader.sri.txt +1 -1
- package/package.json +1 -1
package/dist/vanilla/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
5
5
|
// src/vanilla/index.ts
|
|
6
6
|
|
|
7
7
|
// src/core/version.ts
|
|
8
|
-
var VERSION = "1.0.
|
|
8
|
+
var VERSION = "1.0.6";
|
|
9
9
|
|
|
10
10
|
// src/core/AforoEmbed.ts
|
|
11
11
|
var mountedElements = /* @__PURE__ */ new WeakMap();
|
|
@@ -160,6 +160,7 @@ function pricingCardConfigToProps(config) {
|
|
|
160
160
|
const theme = readEnum(extra.theme, ["light", "dark", "auto"], "auto");
|
|
161
161
|
const locale = typeof extra.locale === "string" ? extra.locale : void 0;
|
|
162
162
|
const maxPlans = typeof extra.maxPlans === "number" && Number.isFinite(extra.maxPlans) ? extra.maxPlans : void 0;
|
|
163
|
+
const borderRadius = typeof extra.borderRadius === "number" && Number.isFinite(extra.borderRadius) ? extra.borderRadius : void 0;
|
|
163
164
|
const ctaText = typeof extra.ctaText === "string" ? extra.ctaText : void 0;
|
|
164
165
|
const ctaUrl = typeof extra.ctaUrl === "string" ? extra.ctaUrl : void 0;
|
|
165
166
|
const showFeatures = typeof extra.showFeatures === "boolean" ? extra.showFeatures : void 0;
|
|
@@ -173,6 +174,7 @@ function pricingCardConfigToProps(config) {
|
|
|
173
174
|
theme,
|
|
174
175
|
locale,
|
|
175
176
|
maxPlans,
|
|
177
|
+
borderRadius,
|
|
176
178
|
showFeatures,
|
|
177
179
|
ctaText,
|
|
178
180
|
ctaUrl,
|
|
@@ -3026,6 +3028,7 @@ function WidgetShell(props) {
|
|
|
3026
3028
|
var DEFAULT_LAYOUT = "horizontal";
|
|
3027
3029
|
var DEFAULT_MAX_PLANS = 4;
|
|
3028
3030
|
var DEFAULT_CTA_TEXT = "Get Started";
|
|
3031
|
+
var DEFAULT_CARD_RADIUS = 12;
|
|
3029
3032
|
function clampLayout(raw) {
|
|
3030
3033
|
return raw === "horizontal" || raw === "vertical" || raw === "table" ? raw : void 0;
|
|
3031
3034
|
}
|
|
@@ -3036,7 +3039,7 @@ function setTenantDefaultsIdempotent(setter, next) {
|
|
|
3036
3039
|
setter((prev) => {
|
|
3037
3040
|
if (prev === next) return prev;
|
|
3038
3041
|
if (!prev && !next) return prev;
|
|
3039
|
-
if (prev && next && prev.layout === next.layout && prev.theme === next.theme && prev.maxPlans === next.maxPlans && prev.showFeatures === next.showFeatures && prev.ctaText === next.ctaText) {
|
|
3042
|
+
if (prev && next && prev.layout === next.layout && prev.theme === next.theme && prev.maxPlans === next.maxPlans && prev.showFeatures === next.showFeatures && prev.ctaText === next.ctaText && prev.borderRadius === next.borderRadius) {
|
|
3040
3043
|
return prev;
|
|
3041
3044
|
}
|
|
3042
3045
|
return next;
|
|
@@ -3051,7 +3054,8 @@ function extractTenantDefaults(config) {
|
|
|
3051
3054
|
theme: typeof raw.theme === "string" ? raw.theme : void 0,
|
|
3052
3055
|
maxPlans: typeof raw.maxPlans === "number" && Number.isFinite(raw.maxPlans) ? raw.maxPlans : void 0,
|
|
3053
3056
|
showFeatures: typeof raw.showFeatures === "boolean" ? raw.showFeatures : void 0,
|
|
3054
|
-
ctaText: typeof raw.ctaText === "string" && raw.ctaText.length > 0 ? raw.ctaText : void 0
|
|
3057
|
+
ctaText: typeof raw.ctaText === "string" && raw.ctaText.length > 0 ? raw.ctaText : void 0,
|
|
3058
|
+
borderRadius: typeof raw.borderRadius === "number" && Number.isFinite(raw.borderRadius) ? raw.borderRadius : void 0
|
|
3055
3059
|
};
|
|
3056
3060
|
}
|
|
3057
3061
|
var DARK_TOKEN_OVERLAY = {
|
|
@@ -3173,6 +3177,7 @@ function PricingCardBody(props) {
|
|
|
3173
3177
|
theme: themeProp,
|
|
3174
3178
|
locale: localeProp,
|
|
3175
3179
|
maxPlans: maxPlansProp,
|
|
3180
|
+
borderRadius: borderRadiusProp,
|
|
3176
3181
|
showFeatures: showFeaturesProp,
|
|
3177
3182
|
ctaText: ctaTextProp,
|
|
3178
3183
|
ctaUrl: ctaUrlProp,
|
|
@@ -3186,6 +3191,7 @@ function PricingCardBody(props) {
|
|
|
3186
3191
|
const maxPlans = typeof maxPlansProp === "number" && Number.isFinite(maxPlansProp) ? maxPlansProp : typeof tenantDefaults?.maxPlans === "number" && Number.isFinite(tenantDefaults.maxPlans) ? tenantDefaults.maxPlans : DEFAULT_MAX_PLANS;
|
|
3187
3192
|
const showFeatures = typeof showFeaturesProp === "boolean" ? showFeaturesProp : typeof tenantDefaults?.showFeatures === "boolean" ? tenantDefaults.showFeatures : true;
|
|
3188
3193
|
const ctaTextEffective = ctaTextProp ?? tenantDefaults?.ctaText ?? void 0;
|
|
3194
|
+
const cardRadius = typeof borderRadiusProp === "number" && Number.isFinite(borderRadiusProp) ? borderRadiusProp : typeof tenantDefaults?.borderRadius === "number" && Number.isFinite(tenantDefaults.borderRadius) ? tenantDefaults.borderRadius : DEFAULT_CARD_RADIUS;
|
|
3189
3195
|
const shell = useWidgetShell();
|
|
3190
3196
|
const { tokens: shellTokens, bridgeClient, telemetry, bus, tenantSlug } = shell;
|
|
3191
3197
|
const isDark = React7.useMemo(() => {
|
|
@@ -3403,7 +3409,8 @@ function PricingCardBody(props) {
|
|
|
3403
3409
|
{
|
|
3404
3410
|
layout,
|
|
3405
3411
|
tokens,
|
|
3406
|
-
prefersReducedMotion
|
|
3412
|
+
prefersReducedMotion,
|
|
3413
|
+
cardRadius
|
|
3407
3414
|
}
|
|
3408
3415
|
)
|
|
3409
3416
|
}
|
|
@@ -3475,7 +3482,8 @@ function PricingCardBody(props) {
|
|
|
3475
3482
|
ctaTextProp: ctaTextEffective,
|
|
3476
3483
|
featuredOverride: featuredOfferingId,
|
|
3477
3484
|
onCtaClick: handleCtaClick,
|
|
3478
|
-
intlOverride
|
|
3485
|
+
intlOverride,
|
|
3486
|
+
cardRadius
|
|
3479
3487
|
}
|
|
3480
3488
|
)
|
|
3481
3489
|
}
|
|
@@ -3490,7 +3498,8 @@ function PlanGrid({
|
|
|
3490
3498
|
ctaTextProp,
|
|
3491
3499
|
featuredOverride,
|
|
3492
3500
|
onCtaClick,
|
|
3493
|
-
intlOverride
|
|
3501
|
+
intlOverride,
|
|
3502
|
+
cardRadius
|
|
3494
3503
|
}) {
|
|
3495
3504
|
const isHorizontal = layout === "horizontal";
|
|
3496
3505
|
const gridStyle2 = isHorizontal ? {
|
|
@@ -3513,7 +3522,8 @@ function PlanGrid({
|
|
|
3513
3522
|
ctaTextProp,
|
|
3514
3523
|
featured: offeringIsFeatured(o, featuredOverride),
|
|
3515
3524
|
onCtaClick,
|
|
3516
|
-
intlOverride
|
|
3525
|
+
intlOverride,
|
|
3526
|
+
cardRadius
|
|
3517
3527
|
},
|
|
3518
3528
|
o.offeringId
|
|
3519
3529
|
)) });
|
|
@@ -3526,7 +3536,8 @@ function PlanCard({
|
|
|
3526
3536
|
ctaTextProp,
|
|
3527
3537
|
featured,
|
|
3528
3538
|
onCtaClick,
|
|
3529
|
-
intlOverride
|
|
3539
|
+
intlOverride,
|
|
3540
|
+
cardRadius
|
|
3530
3541
|
}) {
|
|
3531
3542
|
const { text: price, unitSuffix } = resolveDisplayPrice(offering, locale, intlOverride);
|
|
3532
3543
|
const isContactSales = price === "\u2014";
|
|
@@ -3537,7 +3548,7 @@ function PlanCard({
|
|
|
3537
3548
|
display: "flex",
|
|
3538
3549
|
flexDirection: "column",
|
|
3539
3550
|
padding: 24,
|
|
3540
|
-
borderRadius:
|
|
3551
|
+
borderRadius: cardRadius,
|
|
3541
3552
|
border: featured ? `2px solid ${tokens.primary}` : `1px solid ${tokens.border}`,
|
|
3542
3553
|
background: tokens.bg,
|
|
3543
3554
|
color: tokens.text,
|
|
@@ -3887,7 +3898,8 @@ function cellAria(label, feature) {
|
|
|
3887
3898
|
function LoadingSkeleton({
|
|
3888
3899
|
layout,
|
|
3889
3900
|
tokens,
|
|
3890
|
-
prefersReducedMotion
|
|
3901
|
+
prefersReducedMotion,
|
|
3902
|
+
cardRadius
|
|
3891
3903
|
}) {
|
|
3892
3904
|
const shimmerStyle = prefersReducedMotion ? { background: tokens.border, opacity: 0.6 } : {
|
|
3893
3905
|
background: `linear-gradient(90deg, ${tokens.border} 0%, ${tokens.bg} 50%, ${tokens.border} 100%)`,
|
|
@@ -3920,7 +3932,7 @@ function LoadingSkeleton({
|
|
|
3920
3932
|
"aria-hidden": "true",
|
|
3921
3933
|
style: {
|
|
3922
3934
|
padding: 24,
|
|
3923
|
-
borderRadius:
|
|
3935
|
+
borderRadius: cardRadius,
|
|
3924
3936
|
border: `1px solid ${tokens.border}`,
|
|
3925
3937
|
background: tokens.bg,
|
|
3926
3938
|
minHeight: 280,
|
package/dist/vue/index.cjs
CHANGED
|
@@ -28,7 +28,7 @@ var React7__namespace = /*#__PURE__*/_interopNamespace(React7);
|
|
|
28
28
|
// src/vue/index.ts
|
|
29
29
|
|
|
30
30
|
// src/core/version.ts
|
|
31
|
-
var VERSION = "1.0.
|
|
31
|
+
var VERSION = "1.0.6";
|
|
32
32
|
|
|
33
33
|
// src/core/AforoEmbed.ts
|
|
34
34
|
var mountedElements = /* @__PURE__ */ new WeakMap();
|
|
@@ -183,6 +183,7 @@ function pricingCardConfigToProps(config) {
|
|
|
183
183
|
const theme = readEnum(extra.theme, ["light", "dark", "auto"], "auto");
|
|
184
184
|
const locale = typeof extra.locale === "string" ? extra.locale : void 0;
|
|
185
185
|
const maxPlans = typeof extra.maxPlans === "number" && Number.isFinite(extra.maxPlans) ? extra.maxPlans : void 0;
|
|
186
|
+
const borderRadius = typeof extra.borderRadius === "number" && Number.isFinite(extra.borderRadius) ? extra.borderRadius : void 0;
|
|
186
187
|
const ctaText = typeof extra.ctaText === "string" ? extra.ctaText : void 0;
|
|
187
188
|
const ctaUrl = typeof extra.ctaUrl === "string" ? extra.ctaUrl : void 0;
|
|
188
189
|
const showFeatures = typeof extra.showFeatures === "boolean" ? extra.showFeatures : void 0;
|
|
@@ -196,6 +197,7 @@ function pricingCardConfigToProps(config) {
|
|
|
196
197
|
theme,
|
|
197
198
|
locale,
|
|
198
199
|
maxPlans,
|
|
200
|
+
borderRadius,
|
|
199
201
|
showFeatures,
|
|
200
202
|
ctaText,
|
|
201
203
|
ctaUrl,
|
|
@@ -3049,6 +3051,7 @@ function WidgetShell(props) {
|
|
|
3049
3051
|
var DEFAULT_LAYOUT = "horizontal";
|
|
3050
3052
|
var DEFAULT_MAX_PLANS = 4;
|
|
3051
3053
|
var DEFAULT_CTA_TEXT = "Get Started";
|
|
3054
|
+
var DEFAULT_CARD_RADIUS = 12;
|
|
3052
3055
|
function clampLayout(raw) {
|
|
3053
3056
|
return raw === "horizontal" || raw === "vertical" || raw === "table" ? raw : void 0;
|
|
3054
3057
|
}
|
|
@@ -3059,7 +3062,7 @@ function setTenantDefaultsIdempotent(setter, next) {
|
|
|
3059
3062
|
setter((prev) => {
|
|
3060
3063
|
if (prev === next) return prev;
|
|
3061
3064
|
if (!prev && !next) return prev;
|
|
3062
|
-
if (prev && next && prev.layout === next.layout && prev.theme === next.theme && prev.maxPlans === next.maxPlans && prev.showFeatures === next.showFeatures && prev.ctaText === next.ctaText) {
|
|
3065
|
+
if (prev && next && prev.layout === next.layout && prev.theme === next.theme && prev.maxPlans === next.maxPlans && prev.showFeatures === next.showFeatures && prev.ctaText === next.ctaText && prev.borderRadius === next.borderRadius) {
|
|
3063
3066
|
return prev;
|
|
3064
3067
|
}
|
|
3065
3068
|
return next;
|
|
@@ -3074,7 +3077,8 @@ function extractTenantDefaults(config) {
|
|
|
3074
3077
|
theme: typeof raw.theme === "string" ? raw.theme : void 0,
|
|
3075
3078
|
maxPlans: typeof raw.maxPlans === "number" && Number.isFinite(raw.maxPlans) ? raw.maxPlans : void 0,
|
|
3076
3079
|
showFeatures: typeof raw.showFeatures === "boolean" ? raw.showFeatures : void 0,
|
|
3077
|
-
ctaText: typeof raw.ctaText === "string" && raw.ctaText.length > 0 ? raw.ctaText : void 0
|
|
3080
|
+
ctaText: typeof raw.ctaText === "string" && raw.ctaText.length > 0 ? raw.ctaText : void 0,
|
|
3081
|
+
borderRadius: typeof raw.borderRadius === "number" && Number.isFinite(raw.borderRadius) ? raw.borderRadius : void 0
|
|
3078
3082
|
};
|
|
3079
3083
|
}
|
|
3080
3084
|
var DARK_TOKEN_OVERLAY = {
|
|
@@ -3196,6 +3200,7 @@ function PricingCardBody(props) {
|
|
|
3196
3200
|
theme: themeProp,
|
|
3197
3201
|
locale: localeProp,
|
|
3198
3202
|
maxPlans: maxPlansProp,
|
|
3203
|
+
borderRadius: borderRadiusProp,
|
|
3199
3204
|
showFeatures: showFeaturesProp,
|
|
3200
3205
|
ctaText: ctaTextProp,
|
|
3201
3206
|
ctaUrl: ctaUrlProp,
|
|
@@ -3209,6 +3214,7 @@ function PricingCardBody(props) {
|
|
|
3209
3214
|
const maxPlans = typeof maxPlansProp === "number" && Number.isFinite(maxPlansProp) ? maxPlansProp : typeof tenantDefaults?.maxPlans === "number" && Number.isFinite(tenantDefaults.maxPlans) ? tenantDefaults.maxPlans : DEFAULT_MAX_PLANS;
|
|
3210
3215
|
const showFeatures = typeof showFeaturesProp === "boolean" ? showFeaturesProp : typeof tenantDefaults?.showFeatures === "boolean" ? tenantDefaults.showFeatures : true;
|
|
3211
3216
|
const ctaTextEffective = ctaTextProp ?? tenantDefaults?.ctaText ?? void 0;
|
|
3217
|
+
const cardRadius = typeof borderRadiusProp === "number" && Number.isFinite(borderRadiusProp) ? borderRadiusProp : typeof tenantDefaults?.borderRadius === "number" && Number.isFinite(tenantDefaults.borderRadius) ? tenantDefaults.borderRadius : DEFAULT_CARD_RADIUS;
|
|
3212
3218
|
const shell = useWidgetShell();
|
|
3213
3219
|
const { tokens: shellTokens, bridgeClient, telemetry, bus, tenantSlug } = shell;
|
|
3214
3220
|
const isDark = React7__namespace.useMemo(() => {
|
|
@@ -3426,7 +3432,8 @@ function PricingCardBody(props) {
|
|
|
3426
3432
|
{
|
|
3427
3433
|
layout,
|
|
3428
3434
|
tokens,
|
|
3429
|
-
prefersReducedMotion
|
|
3435
|
+
prefersReducedMotion,
|
|
3436
|
+
cardRadius
|
|
3430
3437
|
}
|
|
3431
3438
|
)
|
|
3432
3439
|
}
|
|
@@ -3498,7 +3505,8 @@ function PricingCardBody(props) {
|
|
|
3498
3505
|
ctaTextProp: ctaTextEffective,
|
|
3499
3506
|
featuredOverride: featuredOfferingId,
|
|
3500
3507
|
onCtaClick: handleCtaClick,
|
|
3501
|
-
intlOverride
|
|
3508
|
+
intlOverride,
|
|
3509
|
+
cardRadius
|
|
3502
3510
|
}
|
|
3503
3511
|
)
|
|
3504
3512
|
}
|
|
@@ -3513,7 +3521,8 @@ function PlanGrid({
|
|
|
3513
3521
|
ctaTextProp,
|
|
3514
3522
|
featuredOverride,
|
|
3515
3523
|
onCtaClick,
|
|
3516
|
-
intlOverride
|
|
3524
|
+
intlOverride,
|
|
3525
|
+
cardRadius
|
|
3517
3526
|
}) {
|
|
3518
3527
|
const isHorizontal = layout === "horizontal";
|
|
3519
3528
|
const gridStyle2 = isHorizontal ? {
|
|
@@ -3536,7 +3545,8 @@ function PlanGrid({
|
|
|
3536
3545
|
ctaTextProp,
|
|
3537
3546
|
featured: offeringIsFeatured(o, featuredOverride),
|
|
3538
3547
|
onCtaClick,
|
|
3539
|
-
intlOverride
|
|
3548
|
+
intlOverride,
|
|
3549
|
+
cardRadius
|
|
3540
3550
|
},
|
|
3541
3551
|
o.offeringId
|
|
3542
3552
|
)) });
|
|
@@ -3549,7 +3559,8 @@ function PlanCard({
|
|
|
3549
3559
|
ctaTextProp,
|
|
3550
3560
|
featured,
|
|
3551
3561
|
onCtaClick,
|
|
3552
|
-
intlOverride
|
|
3562
|
+
intlOverride,
|
|
3563
|
+
cardRadius
|
|
3553
3564
|
}) {
|
|
3554
3565
|
const { text: price, unitSuffix } = resolveDisplayPrice(offering, locale, intlOverride);
|
|
3555
3566
|
const isContactSales = price === "\u2014";
|
|
@@ -3560,7 +3571,7 @@ function PlanCard({
|
|
|
3560
3571
|
display: "flex",
|
|
3561
3572
|
flexDirection: "column",
|
|
3562
3573
|
padding: 24,
|
|
3563
|
-
borderRadius:
|
|
3574
|
+
borderRadius: cardRadius,
|
|
3564
3575
|
border: featured ? `2px solid ${tokens.primary}` : `1px solid ${tokens.border}`,
|
|
3565
3576
|
background: tokens.bg,
|
|
3566
3577
|
color: tokens.text,
|
|
@@ -3910,7 +3921,8 @@ function cellAria(label, feature) {
|
|
|
3910
3921
|
function LoadingSkeleton({
|
|
3911
3922
|
layout,
|
|
3912
3923
|
tokens,
|
|
3913
|
-
prefersReducedMotion
|
|
3924
|
+
prefersReducedMotion,
|
|
3925
|
+
cardRadius
|
|
3914
3926
|
}) {
|
|
3915
3927
|
const shimmerStyle = prefersReducedMotion ? { background: tokens.border, opacity: 0.6 } : {
|
|
3916
3928
|
background: `linear-gradient(90deg, ${tokens.border} 0%, ${tokens.bg} 50%, ${tokens.border} 100%)`,
|
|
@@ -3943,7 +3955,7 @@ function LoadingSkeleton({
|
|
|
3943
3955
|
"aria-hidden": "true",
|
|
3944
3956
|
style: {
|
|
3945
3957
|
padding: 24,
|
|
3946
|
-
borderRadius:
|
|
3958
|
+
borderRadius: cardRadius,
|
|
3947
3959
|
border: `1px solid ${tokens.border}`,
|
|
3948
3960
|
background: tokens.bg,
|
|
3949
3961
|
minHeight: 280,
|
package/dist/vue/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
6
6
|
// src/vue/index.ts
|
|
7
7
|
|
|
8
8
|
// src/core/version.ts
|
|
9
|
-
var VERSION = "1.0.
|
|
9
|
+
var VERSION = "1.0.6";
|
|
10
10
|
|
|
11
11
|
// src/core/AforoEmbed.ts
|
|
12
12
|
var mountedElements = /* @__PURE__ */ new WeakMap();
|
|
@@ -161,6 +161,7 @@ function pricingCardConfigToProps(config) {
|
|
|
161
161
|
const theme = readEnum(extra.theme, ["light", "dark", "auto"], "auto");
|
|
162
162
|
const locale = typeof extra.locale === "string" ? extra.locale : void 0;
|
|
163
163
|
const maxPlans = typeof extra.maxPlans === "number" && Number.isFinite(extra.maxPlans) ? extra.maxPlans : void 0;
|
|
164
|
+
const borderRadius = typeof extra.borderRadius === "number" && Number.isFinite(extra.borderRadius) ? extra.borderRadius : void 0;
|
|
164
165
|
const ctaText = typeof extra.ctaText === "string" ? extra.ctaText : void 0;
|
|
165
166
|
const ctaUrl = typeof extra.ctaUrl === "string" ? extra.ctaUrl : void 0;
|
|
166
167
|
const showFeatures = typeof extra.showFeatures === "boolean" ? extra.showFeatures : void 0;
|
|
@@ -174,6 +175,7 @@ function pricingCardConfigToProps(config) {
|
|
|
174
175
|
theme,
|
|
175
176
|
locale,
|
|
176
177
|
maxPlans,
|
|
178
|
+
borderRadius,
|
|
177
179
|
showFeatures,
|
|
178
180
|
ctaText,
|
|
179
181
|
ctaUrl,
|
|
@@ -3027,6 +3029,7 @@ function WidgetShell(props) {
|
|
|
3027
3029
|
var DEFAULT_LAYOUT = "horizontal";
|
|
3028
3030
|
var DEFAULT_MAX_PLANS = 4;
|
|
3029
3031
|
var DEFAULT_CTA_TEXT = "Get Started";
|
|
3032
|
+
var DEFAULT_CARD_RADIUS = 12;
|
|
3030
3033
|
function clampLayout(raw) {
|
|
3031
3034
|
return raw === "horizontal" || raw === "vertical" || raw === "table" ? raw : void 0;
|
|
3032
3035
|
}
|
|
@@ -3037,7 +3040,7 @@ function setTenantDefaultsIdempotent(setter, next) {
|
|
|
3037
3040
|
setter((prev) => {
|
|
3038
3041
|
if (prev === next) return prev;
|
|
3039
3042
|
if (!prev && !next) return prev;
|
|
3040
|
-
if (prev && next && prev.layout === next.layout && prev.theme === next.theme && prev.maxPlans === next.maxPlans && prev.showFeatures === next.showFeatures && prev.ctaText === next.ctaText) {
|
|
3043
|
+
if (prev && next && prev.layout === next.layout && prev.theme === next.theme && prev.maxPlans === next.maxPlans && prev.showFeatures === next.showFeatures && prev.ctaText === next.ctaText && prev.borderRadius === next.borderRadius) {
|
|
3041
3044
|
return prev;
|
|
3042
3045
|
}
|
|
3043
3046
|
return next;
|
|
@@ -3052,7 +3055,8 @@ function extractTenantDefaults(config) {
|
|
|
3052
3055
|
theme: typeof raw.theme === "string" ? raw.theme : void 0,
|
|
3053
3056
|
maxPlans: typeof raw.maxPlans === "number" && Number.isFinite(raw.maxPlans) ? raw.maxPlans : void 0,
|
|
3054
3057
|
showFeatures: typeof raw.showFeatures === "boolean" ? raw.showFeatures : void 0,
|
|
3055
|
-
ctaText: typeof raw.ctaText === "string" && raw.ctaText.length > 0 ? raw.ctaText : void 0
|
|
3058
|
+
ctaText: typeof raw.ctaText === "string" && raw.ctaText.length > 0 ? raw.ctaText : void 0,
|
|
3059
|
+
borderRadius: typeof raw.borderRadius === "number" && Number.isFinite(raw.borderRadius) ? raw.borderRadius : void 0
|
|
3056
3060
|
};
|
|
3057
3061
|
}
|
|
3058
3062
|
var DARK_TOKEN_OVERLAY = {
|
|
@@ -3174,6 +3178,7 @@ function PricingCardBody(props) {
|
|
|
3174
3178
|
theme: themeProp,
|
|
3175
3179
|
locale: localeProp,
|
|
3176
3180
|
maxPlans: maxPlansProp,
|
|
3181
|
+
borderRadius: borderRadiusProp,
|
|
3177
3182
|
showFeatures: showFeaturesProp,
|
|
3178
3183
|
ctaText: ctaTextProp,
|
|
3179
3184
|
ctaUrl: ctaUrlProp,
|
|
@@ -3187,6 +3192,7 @@ function PricingCardBody(props) {
|
|
|
3187
3192
|
const maxPlans = typeof maxPlansProp === "number" && Number.isFinite(maxPlansProp) ? maxPlansProp : typeof tenantDefaults?.maxPlans === "number" && Number.isFinite(tenantDefaults.maxPlans) ? tenantDefaults.maxPlans : DEFAULT_MAX_PLANS;
|
|
3188
3193
|
const showFeatures = typeof showFeaturesProp === "boolean" ? showFeaturesProp : typeof tenantDefaults?.showFeatures === "boolean" ? tenantDefaults.showFeatures : true;
|
|
3189
3194
|
const ctaTextEffective = ctaTextProp ?? tenantDefaults?.ctaText ?? void 0;
|
|
3195
|
+
const cardRadius = typeof borderRadiusProp === "number" && Number.isFinite(borderRadiusProp) ? borderRadiusProp : typeof tenantDefaults?.borderRadius === "number" && Number.isFinite(tenantDefaults.borderRadius) ? tenantDefaults.borderRadius : DEFAULT_CARD_RADIUS;
|
|
3190
3196
|
const shell = useWidgetShell();
|
|
3191
3197
|
const { tokens: shellTokens, bridgeClient, telemetry, bus, tenantSlug } = shell;
|
|
3192
3198
|
const isDark = React7.useMemo(() => {
|
|
@@ -3404,7 +3410,8 @@ function PricingCardBody(props) {
|
|
|
3404
3410
|
{
|
|
3405
3411
|
layout,
|
|
3406
3412
|
tokens,
|
|
3407
|
-
prefersReducedMotion
|
|
3413
|
+
prefersReducedMotion,
|
|
3414
|
+
cardRadius
|
|
3408
3415
|
}
|
|
3409
3416
|
)
|
|
3410
3417
|
}
|
|
@@ -3476,7 +3483,8 @@ function PricingCardBody(props) {
|
|
|
3476
3483
|
ctaTextProp: ctaTextEffective,
|
|
3477
3484
|
featuredOverride: featuredOfferingId,
|
|
3478
3485
|
onCtaClick: handleCtaClick,
|
|
3479
|
-
intlOverride
|
|
3486
|
+
intlOverride,
|
|
3487
|
+
cardRadius
|
|
3480
3488
|
}
|
|
3481
3489
|
)
|
|
3482
3490
|
}
|
|
@@ -3491,7 +3499,8 @@ function PlanGrid({
|
|
|
3491
3499
|
ctaTextProp,
|
|
3492
3500
|
featuredOverride,
|
|
3493
3501
|
onCtaClick,
|
|
3494
|
-
intlOverride
|
|
3502
|
+
intlOverride,
|
|
3503
|
+
cardRadius
|
|
3495
3504
|
}) {
|
|
3496
3505
|
const isHorizontal = layout === "horizontal";
|
|
3497
3506
|
const gridStyle2 = isHorizontal ? {
|
|
@@ -3514,7 +3523,8 @@ function PlanGrid({
|
|
|
3514
3523
|
ctaTextProp,
|
|
3515
3524
|
featured: offeringIsFeatured(o, featuredOverride),
|
|
3516
3525
|
onCtaClick,
|
|
3517
|
-
intlOverride
|
|
3526
|
+
intlOverride,
|
|
3527
|
+
cardRadius
|
|
3518
3528
|
},
|
|
3519
3529
|
o.offeringId
|
|
3520
3530
|
)) });
|
|
@@ -3527,7 +3537,8 @@ function PlanCard({
|
|
|
3527
3537
|
ctaTextProp,
|
|
3528
3538
|
featured,
|
|
3529
3539
|
onCtaClick,
|
|
3530
|
-
intlOverride
|
|
3540
|
+
intlOverride,
|
|
3541
|
+
cardRadius
|
|
3531
3542
|
}) {
|
|
3532
3543
|
const { text: price, unitSuffix } = resolveDisplayPrice(offering, locale, intlOverride);
|
|
3533
3544
|
const isContactSales = price === "\u2014";
|
|
@@ -3538,7 +3549,7 @@ function PlanCard({
|
|
|
3538
3549
|
display: "flex",
|
|
3539
3550
|
flexDirection: "column",
|
|
3540
3551
|
padding: 24,
|
|
3541
|
-
borderRadius:
|
|
3552
|
+
borderRadius: cardRadius,
|
|
3542
3553
|
border: featured ? `2px solid ${tokens.primary}` : `1px solid ${tokens.border}`,
|
|
3543
3554
|
background: tokens.bg,
|
|
3544
3555
|
color: tokens.text,
|
|
@@ -3888,7 +3899,8 @@ function cellAria(label, feature) {
|
|
|
3888
3899
|
function LoadingSkeleton({
|
|
3889
3900
|
layout,
|
|
3890
3901
|
tokens,
|
|
3891
|
-
prefersReducedMotion
|
|
3902
|
+
prefersReducedMotion,
|
|
3903
|
+
cardRadius
|
|
3892
3904
|
}) {
|
|
3893
3905
|
const shimmerStyle = prefersReducedMotion ? { background: tokens.border, opacity: 0.6 } : {
|
|
3894
3906
|
background: `linear-gradient(90deg, ${tokens.border} 0%, ${tokens.bg} 50%, ${tokens.border} 100%)`,
|
|
@@ -3921,7 +3933,7 @@ function LoadingSkeleton({
|
|
|
3921
3933
|
"aria-hidden": "true",
|
|
3922
3934
|
style: {
|
|
3923
3935
|
padding: 24,
|
|
3924
|
-
borderRadius:
|
|
3936
|
+
borderRadius: cardRadius,
|
|
3925
3937
|
border: `1px solid ${tokens.border}`,
|
|
3926
3938
|
background: tokens.bg,
|
|
3927
3939
|
minHeight: 280,
|