@kerne/react 0.1.3 → 1.1.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/README.md +18 -5
- package/dist/{chunk-F6NV76OR.js → chunk-IZMRK3WK.js} +150 -16
- package/dist/{chunk-7U3QBMA7.cjs → chunk-TYNZ2WU7.cjs} +156 -22
- package/dist/{i18n-BWTT1DWD.d.cts → i18n-QilNgwqe.d.cts} +33 -0
- package/dist/{i18n-BWTT1DWD.d.ts → i18n-QilNgwqe.d.ts} +33 -0
- package/dist/index.cjs +18 -20
- package/dist/index.d.cts +97 -13
- package/dist/index.d.ts +97 -13
- package/dist/index.js +13 -15
- package/dist/ui/index.cjs +669 -131
- package/dist/ui/index.d.cts +139 -4
- package/dist/ui/index.d.ts +139 -4
- package/dist/ui/index.js +602 -64
- package/package.json +3 -3
package/dist/ui/index.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { SubscriptionWithPlan } from '@kerne/types';
|
|
4
|
-
|
|
3
|
+
import { PublicPlan, PublicPriceLabel, PublicPlanPrice, SubscriptionWithPlan } from '@kerne/types';
|
|
4
|
+
import { K as KerneLocalization } from '../i18n-QilNgwqe.cjs';
|
|
5
|
+
export { d as defaultLocalization, u as useLocalization } from '../i18n-QilNgwqe.cjs';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Per-instance overrides of the same custom properties the stylesheet reads,
|
|
@@ -332,8 +333,10 @@ interface SubscriptionCardProps extends Omit<KerneUIProps, 'logo'> {
|
|
|
332
333
|
onUpgradeClick?: () => void;
|
|
333
334
|
/** Hide the "Manage billing" button (e.g. when the page has its own). */
|
|
334
335
|
hidePortalButton?: boolean;
|
|
336
|
+
/** Hide the "Cancel subscription" button, e.g. when cancellation goes through sales/support. */
|
|
337
|
+
hideCancelButton?: boolean;
|
|
335
338
|
}
|
|
336
|
-
declare function SubscriptionCard({ productSlug, title, portalReturnUrl, upgradeUrl, onUpgradeClick, hidePortalButton, appearance, className, }: SubscriptionCardProps): react_jsx_runtime.JSX.Element;
|
|
339
|
+
declare function SubscriptionCard({ productSlug, title, portalReturnUrl, upgradeUrl, onUpgradeClick, hidePortalButton, hideCancelButton, appearance, className, }: SubscriptionCardProps): react_jsx_runtime.JSX.Element;
|
|
337
340
|
|
|
338
341
|
interface UsageMetersProps extends Omit<KerneUIProps, 'logo'> {
|
|
339
342
|
/** Heading above the meters. Omit for the localized default, `null` for none. */
|
|
@@ -351,6 +354,138 @@ interface UsageMetersProps extends Omit<KerneUIProps, 'logo'> {
|
|
|
351
354
|
}
|
|
352
355
|
declare function UsageMeters({ title, featureKeys, showUnlimited, limit: maxRows, labels, emptyState, appearance, className, }: UsageMetersProps): react_jsx_runtime.JSX.Element;
|
|
353
356
|
|
|
357
|
+
/**
|
|
358
|
+
* Display helpers shared by the billing and usage components.
|
|
359
|
+
*/
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Last-resort label for a feature.
|
|
363
|
+
*
|
|
364
|
+
* `GET /v1/billing/entitlements` returns `feature_key` but no `feature_name`
|
|
365
|
+
* (see EntitlementSummary), while the subscription payload does carry names -
|
|
366
|
+
* so components cross-reference the subscription first and only fall back
|
|
367
|
+
* here for a scope on a default pack, which has no subscription to read names
|
|
368
|
+
* from. Turning `api_calls` into "Api calls" is not as good as the real name;
|
|
369
|
+
* it is only better than showing a raw key to an end user.
|
|
370
|
+
*/
|
|
371
|
+
declare function humanizeFeatureKey(key: string): string;
|
|
372
|
+
/** Amounts are stored in minor units (cents), as the provider APIs return them. */
|
|
373
|
+
declare function formatMoney(amountMinorUnits: number, currency: string): string;
|
|
374
|
+
declare function formatNumber(value: number): string;
|
|
375
|
+
declare function formatDate(iso: string | null): string | null;
|
|
376
|
+
/**
|
|
377
|
+
* Normalises the provider's interval wording, then localizes it.
|
|
378
|
+
*
|
|
379
|
+
* `PlanPrice.interval` is Kerne's own "N+cycle" encoding ("1M", "3M", "1Y",
|
|
380
|
+
* "30D" - see apps/api's interval.ts), checked first since it's what every
|
|
381
|
+
* subscription/plan payload actually carries. The word-based fallback below
|
|
382
|
+
* stays for any raw provider string passed directly (Stripe says `month`,
|
|
383
|
+
* Polar says `monthly` - same thing to a reader). An interval matching
|
|
384
|
+
* neither falls through unchanged rather than being dropped: better a raw
|
|
385
|
+
* value than a price with no period attached.
|
|
386
|
+
*/
|
|
387
|
+
declare function formatInterval(interval: string, labels: IntervalLabels): string;
|
|
388
|
+
type IntervalLabels = Pick<KerneLocalization['billing'], 'intervalMonth' | 'intervalYear' | 'intervalWeek' | 'intervalDay'>;
|
|
389
|
+
interface PriceDisplay {
|
|
390
|
+
/** What's actually charged - show this alongside displayAmount, never hide it. */
|
|
391
|
+
billedAmount: number;
|
|
392
|
+
billedInterval: string;
|
|
393
|
+
/** The headline number a PriceLabel.display_interval asks to show instead. */
|
|
394
|
+
displayAmount: number;
|
|
395
|
+
displayInterval: string;
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Resolves what to show for a price under a label's `display_interval` -
|
|
399
|
+
* e.g. an annual price shown as its monthly equivalent while still billing
|
|
400
|
+
* annually. `null`/`undefined`/equal-to-billed pass through unchanged. Divides
|
|
401
|
+
* once via approxMonths()'s ratio, never divide-then-multiply back to
|
|
402
|
+
* "verify" - a price rarely divides evenly (100 EUR/year -> 8.33 EUR/month,
|
|
403
|
+
* and 8.33 * 12 = 99.96, not 100).
|
|
404
|
+
*/
|
|
405
|
+
declare function resolvePriceDisplay(price: {
|
|
406
|
+
amount: number;
|
|
407
|
+
interval: string;
|
|
408
|
+
}, displayInterval: string | null | undefined): PriceDisplay;
|
|
409
|
+
/**
|
|
410
|
+
* One entry per distinct PriceLabel across a plan catalog, in owner order
|
|
411
|
+
* (PriceLabel.sort_order, never alphabetical) - shared by every surface that
|
|
412
|
+
* renders a label switch ("Monthly"/"Annual" and similar).
|
|
413
|
+
*/
|
|
414
|
+
declare function collectPriceLabels(plans: PublicPlan[]): PublicPriceLabel[];
|
|
415
|
+
interface LabelSavings {
|
|
416
|
+
labelSlug: string;
|
|
417
|
+
percent: number;
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* Per-month discount of the longest-billed label vs the shortest-billed one -
|
|
421
|
+
* the "Save X%" hint on a label switch. Compares what's actually charged
|
|
422
|
+
* (interval/amount), never the display_interval cosmetic - a label showing
|
|
423
|
+
* "10 EUR/mo" for an annual price still bills the year, and that's what the
|
|
424
|
+
* saving has to stay true about. Only returned once an actual plan prices
|
|
425
|
+
* both ends of the range: nothing is inferred from a single price, and a
|
|
426
|
+
* catalog that only sells the longest label can't claim a discount that
|
|
427
|
+
* doesn't apply to it.
|
|
428
|
+
*/
|
|
429
|
+
declare function resolveLabelSavings(plans: PublicPlan[], labels: PublicPriceLabel[]): LabelSavings | null;
|
|
430
|
+
|
|
431
|
+
interface PricingTableContextValue {
|
|
432
|
+
plans: PublicPlan[];
|
|
433
|
+
labels: PublicPriceLabel[];
|
|
434
|
+
selectedLabelSlug: string | null;
|
|
435
|
+
setSelectedLabelSlug: (slug: string) => void;
|
|
436
|
+
savings: LabelSavings | null;
|
|
437
|
+
currentPlanId: string | null;
|
|
438
|
+
busyPriceId: string | null;
|
|
439
|
+
onSelectPlan: (plan: PublicPlan) => void;
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Headless access to the same state `<PricingTable.LabelSwitch>`/`<PricingTable.Plan>`
|
|
443
|
+
* read - for a host building a fully custom layout around the data instead of
|
|
444
|
+
* the provided subcomponents. Must be called under `<PricingTable>`.
|
|
445
|
+
*/
|
|
446
|
+
declare function usePricingTable(): PricingTableContextValue;
|
|
447
|
+
interface PricingTableProps extends Omit<KerneUIProps, 'logo'> {
|
|
448
|
+
/** Product the plans are read from. Omit for the tenant's default product. */
|
|
449
|
+
product?: string;
|
|
450
|
+
/** Label slug selected on first render. Defaults to the first label by PriceLabel.sort_order once the catalog loads. */
|
|
451
|
+
defaultLabel?: string;
|
|
452
|
+
/** Where the provider checkout should return to. */
|
|
453
|
+
checkoutSuccessUrl?: string;
|
|
454
|
+
checkoutCancelUrl?: string;
|
|
455
|
+
/** Overrides the built-in checkout - e.g. a marketing site that wants its own confirmation step first. */
|
|
456
|
+
onSelectPlan?: (plan: PublicPlan, price: PublicPlanPrice) => void;
|
|
457
|
+
children: React.ReactNode;
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Provider + layout root. Renders a skeleton while the catalog loads and an
|
|
461
|
+
* error panel if it fails, so `<PricingTable.Plan>` children only ever mount
|
|
462
|
+
* once real data exists - they never have to handle a "plan not loaded yet"
|
|
463
|
+
* state of their own.
|
|
464
|
+
*/
|
|
465
|
+
declare function PricingTable({ product, defaultLabel, checkoutSuccessUrl, checkoutCancelUrl, onSelectPlan, appearance, className, children, }: PricingTableProps): react_jsx_runtime.JSX.Element;
|
|
466
|
+
declare namespace PricingTable {
|
|
467
|
+
var LabelSwitch: () => react_jsx_runtime.JSX.Element | null;
|
|
468
|
+
var Plan: ({ slug, featured, badge, maxFeatures }: PricingTablePlanProps) => react_jsx_runtime.JSX.Element | null;
|
|
469
|
+
var Plans: ({ featuredSlug, featuredBadge, maxFeatures }: PricingTablePlansProps) => react_jsx_runtime.JSX.Element;
|
|
470
|
+
}
|
|
471
|
+
interface PricingTablePlanProps {
|
|
472
|
+
/** The plan to render - matched against `Plan.slug`. */
|
|
473
|
+
slug: string;
|
|
474
|
+
/** Visually distinguished (stronger border, soft elevation) - a host decision, never inferred from `is_default` (the free-tier fallback, not a "recommended" signal). */
|
|
475
|
+
featured?: boolean;
|
|
476
|
+
/** Eyebrow shown above the plan name, e.g. "Most popular". Only rendered when passed - no badge is invented from data. */
|
|
477
|
+
badge?: string;
|
|
478
|
+
/** Cap how many entitlements render before "+N more". Omit to show all. */
|
|
479
|
+
maxFeatures?: number;
|
|
480
|
+
}
|
|
481
|
+
interface PricingTablePlansProps {
|
|
482
|
+
/** Slug of the plan to visually feature - a host decision, see PricingTablePlanProps.featured. */
|
|
483
|
+
featuredSlug?: string;
|
|
484
|
+
/** Eyebrow on the featured plan, e.g. "Most popular". */
|
|
485
|
+
featuredBadge?: string;
|
|
486
|
+
maxFeatures?: number;
|
|
487
|
+
}
|
|
488
|
+
|
|
354
489
|
interface CheckoutResultProps extends KerneUIProps {
|
|
355
490
|
/** `cancel` renders the abandoned-checkout copy and skips polling entirely. */
|
|
356
491
|
outcome?: 'success' | 'cancel';
|
|
@@ -388,4 +523,4 @@ interface UpgradePromptProps extends Omit<KerneUIProps, 'logo'> {
|
|
|
388
523
|
}
|
|
389
524
|
declare function UpgradePrompt({ featureKey, requested, featureName, children, upgradeUrl, onUpgradeClick, upgradeLabel, title, description, hideWhileLoading, appearance, className, }: UpgradePromptProps): react_jsx_runtime.JSX.Element | null;
|
|
390
525
|
|
|
391
|
-
export { ActivateAccountForm, type ActivateAccountFormProps, AuthFlow, type AuthFlowProps, type AuthFlowStep, BillingSection, type BillingSectionProps, ChangePasswordForm, type ChangePasswordFormProps, CheckoutResult, type CheckoutResultProps, ForgotPasswordForm, type ForgotPasswordFormProps, type KerneAppearance, LoginForm, type LoginFormProps, MagicLinkCallback, type MagicLinkCallbackProps, ProfileSection, type ProfileSectionProps, RegisterForm, type RegisterFormProps, ResetPasswordForm, type ResetPasswordFormProps, SecuritySection, type SecuritySectionProps, SignOutButton, type SignOutButtonProps, SubscriptionCard, type SubscriptionCardProps, UpgradePrompt, type UpgradePromptProps, UsageMeters, type UsageMetersProps, UserButton, type UserButtonMenuItem, type UserButtonProps, UserProfile, type UserProfileExtraTab, type UserProfileProps, type UserProfileTab, VerifyEmailForm, type VerifyEmailFormProps, WaitlistForm, type WaitlistFormProps };
|
|
526
|
+
export { ActivateAccountForm, type ActivateAccountFormProps, AuthFlow, type AuthFlowProps, type AuthFlowStep, BillingSection, type BillingSectionProps, ChangePasswordForm, type ChangePasswordFormProps, CheckoutResult, type CheckoutResultProps, ForgotPasswordForm, type ForgotPasswordFormProps, type KerneAppearance, KerneLocalization, type LabelSavings, LoginForm, type LoginFormProps, MagicLinkCallback, type MagicLinkCallbackProps, type PriceDisplay, PricingTable, type PricingTablePlanProps, type PricingTablePlansProps, type PricingTableProps, ProfileSection, type ProfileSectionProps, RegisterForm, type RegisterFormProps, ResetPasswordForm, type ResetPasswordFormProps, SecuritySection, type SecuritySectionProps, SignOutButton, type SignOutButtonProps, SubscriptionCard, type SubscriptionCardProps, UpgradePrompt, type UpgradePromptProps, UsageMeters, type UsageMetersProps, UserButton, type UserButtonMenuItem, type UserButtonProps, UserProfile, type UserProfileExtraTab, type UserProfileProps, type UserProfileTab, VerifyEmailForm, type VerifyEmailFormProps, WaitlistForm, type WaitlistFormProps, collectPriceLabels, formatDate, formatInterval, formatMoney, formatNumber, humanizeFeatureKey, resolveLabelSavings, resolvePriceDisplay, usePricingTable };
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { SubscriptionWithPlan } from '@kerne/types';
|
|
4
|
-
|
|
3
|
+
import { PublicPlan, PublicPriceLabel, PublicPlanPrice, SubscriptionWithPlan } from '@kerne/types';
|
|
4
|
+
import { K as KerneLocalization } from '../i18n-QilNgwqe.js';
|
|
5
|
+
export { d as defaultLocalization, u as useLocalization } from '../i18n-QilNgwqe.js';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Per-instance overrides of the same custom properties the stylesheet reads,
|
|
@@ -332,8 +333,10 @@ interface SubscriptionCardProps extends Omit<KerneUIProps, 'logo'> {
|
|
|
332
333
|
onUpgradeClick?: () => void;
|
|
333
334
|
/** Hide the "Manage billing" button (e.g. when the page has its own). */
|
|
334
335
|
hidePortalButton?: boolean;
|
|
336
|
+
/** Hide the "Cancel subscription" button, e.g. when cancellation goes through sales/support. */
|
|
337
|
+
hideCancelButton?: boolean;
|
|
335
338
|
}
|
|
336
|
-
declare function SubscriptionCard({ productSlug, title, portalReturnUrl, upgradeUrl, onUpgradeClick, hidePortalButton, appearance, className, }: SubscriptionCardProps): react_jsx_runtime.JSX.Element;
|
|
339
|
+
declare function SubscriptionCard({ productSlug, title, portalReturnUrl, upgradeUrl, onUpgradeClick, hidePortalButton, hideCancelButton, appearance, className, }: SubscriptionCardProps): react_jsx_runtime.JSX.Element;
|
|
337
340
|
|
|
338
341
|
interface UsageMetersProps extends Omit<KerneUIProps, 'logo'> {
|
|
339
342
|
/** Heading above the meters. Omit for the localized default, `null` for none. */
|
|
@@ -351,6 +354,138 @@ interface UsageMetersProps extends Omit<KerneUIProps, 'logo'> {
|
|
|
351
354
|
}
|
|
352
355
|
declare function UsageMeters({ title, featureKeys, showUnlimited, limit: maxRows, labels, emptyState, appearance, className, }: UsageMetersProps): react_jsx_runtime.JSX.Element;
|
|
353
356
|
|
|
357
|
+
/**
|
|
358
|
+
* Display helpers shared by the billing and usage components.
|
|
359
|
+
*/
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Last-resort label for a feature.
|
|
363
|
+
*
|
|
364
|
+
* `GET /v1/billing/entitlements` returns `feature_key` but no `feature_name`
|
|
365
|
+
* (see EntitlementSummary), while the subscription payload does carry names -
|
|
366
|
+
* so components cross-reference the subscription first and only fall back
|
|
367
|
+
* here for a scope on a default pack, which has no subscription to read names
|
|
368
|
+
* from. Turning `api_calls` into "Api calls" is not as good as the real name;
|
|
369
|
+
* it is only better than showing a raw key to an end user.
|
|
370
|
+
*/
|
|
371
|
+
declare function humanizeFeatureKey(key: string): string;
|
|
372
|
+
/** Amounts are stored in minor units (cents), as the provider APIs return them. */
|
|
373
|
+
declare function formatMoney(amountMinorUnits: number, currency: string): string;
|
|
374
|
+
declare function formatNumber(value: number): string;
|
|
375
|
+
declare function formatDate(iso: string | null): string | null;
|
|
376
|
+
/**
|
|
377
|
+
* Normalises the provider's interval wording, then localizes it.
|
|
378
|
+
*
|
|
379
|
+
* `PlanPrice.interval` is Kerne's own "N+cycle" encoding ("1M", "3M", "1Y",
|
|
380
|
+
* "30D" - see apps/api's interval.ts), checked first since it's what every
|
|
381
|
+
* subscription/plan payload actually carries. The word-based fallback below
|
|
382
|
+
* stays for any raw provider string passed directly (Stripe says `month`,
|
|
383
|
+
* Polar says `monthly` - same thing to a reader). An interval matching
|
|
384
|
+
* neither falls through unchanged rather than being dropped: better a raw
|
|
385
|
+
* value than a price with no period attached.
|
|
386
|
+
*/
|
|
387
|
+
declare function formatInterval(interval: string, labels: IntervalLabels): string;
|
|
388
|
+
type IntervalLabels = Pick<KerneLocalization['billing'], 'intervalMonth' | 'intervalYear' | 'intervalWeek' | 'intervalDay'>;
|
|
389
|
+
interface PriceDisplay {
|
|
390
|
+
/** What's actually charged - show this alongside displayAmount, never hide it. */
|
|
391
|
+
billedAmount: number;
|
|
392
|
+
billedInterval: string;
|
|
393
|
+
/** The headline number a PriceLabel.display_interval asks to show instead. */
|
|
394
|
+
displayAmount: number;
|
|
395
|
+
displayInterval: string;
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Resolves what to show for a price under a label's `display_interval` -
|
|
399
|
+
* e.g. an annual price shown as its monthly equivalent while still billing
|
|
400
|
+
* annually. `null`/`undefined`/equal-to-billed pass through unchanged. Divides
|
|
401
|
+
* once via approxMonths()'s ratio, never divide-then-multiply back to
|
|
402
|
+
* "verify" - a price rarely divides evenly (100 EUR/year -> 8.33 EUR/month,
|
|
403
|
+
* and 8.33 * 12 = 99.96, not 100).
|
|
404
|
+
*/
|
|
405
|
+
declare function resolvePriceDisplay(price: {
|
|
406
|
+
amount: number;
|
|
407
|
+
interval: string;
|
|
408
|
+
}, displayInterval: string | null | undefined): PriceDisplay;
|
|
409
|
+
/**
|
|
410
|
+
* One entry per distinct PriceLabel across a plan catalog, in owner order
|
|
411
|
+
* (PriceLabel.sort_order, never alphabetical) - shared by every surface that
|
|
412
|
+
* renders a label switch ("Monthly"/"Annual" and similar).
|
|
413
|
+
*/
|
|
414
|
+
declare function collectPriceLabels(plans: PublicPlan[]): PublicPriceLabel[];
|
|
415
|
+
interface LabelSavings {
|
|
416
|
+
labelSlug: string;
|
|
417
|
+
percent: number;
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* Per-month discount of the longest-billed label vs the shortest-billed one -
|
|
421
|
+
* the "Save X%" hint on a label switch. Compares what's actually charged
|
|
422
|
+
* (interval/amount), never the display_interval cosmetic - a label showing
|
|
423
|
+
* "10 EUR/mo" for an annual price still bills the year, and that's what the
|
|
424
|
+
* saving has to stay true about. Only returned once an actual plan prices
|
|
425
|
+
* both ends of the range: nothing is inferred from a single price, and a
|
|
426
|
+
* catalog that only sells the longest label can't claim a discount that
|
|
427
|
+
* doesn't apply to it.
|
|
428
|
+
*/
|
|
429
|
+
declare function resolveLabelSavings(plans: PublicPlan[], labels: PublicPriceLabel[]): LabelSavings | null;
|
|
430
|
+
|
|
431
|
+
interface PricingTableContextValue {
|
|
432
|
+
plans: PublicPlan[];
|
|
433
|
+
labels: PublicPriceLabel[];
|
|
434
|
+
selectedLabelSlug: string | null;
|
|
435
|
+
setSelectedLabelSlug: (slug: string) => void;
|
|
436
|
+
savings: LabelSavings | null;
|
|
437
|
+
currentPlanId: string | null;
|
|
438
|
+
busyPriceId: string | null;
|
|
439
|
+
onSelectPlan: (plan: PublicPlan) => void;
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Headless access to the same state `<PricingTable.LabelSwitch>`/`<PricingTable.Plan>`
|
|
443
|
+
* read - for a host building a fully custom layout around the data instead of
|
|
444
|
+
* the provided subcomponents. Must be called under `<PricingTable>`.
|
|
445
|
+
*/
|
|
446
|
+
declare function usePricingTable(): PricingTableContextValue;
|
|
447
|
+
interface PricingTableProps extends Omit<KerneUIProps, 'logo'> {
|
|
448
|
+
/** Product the plans are read from. Omit for the tenant's default product. */
|
|
449
|
+
product?: string;
|
|
450
|
+
/** Label slug selected on first render. Defaults to the first label by PriceLabel.sort_order once the catalog loads. */
|
|
451
|
+
defaultLabel?: string;
|
|
452
|
+
/** Where the provider checkout should return to. */
|
|
453
|
+
checkoutSuccessUrl?: string;
|
|
454
|
+
checkoutCancelUrl?: string;
|
|
455
|
+
/** Overrides the built-in checkout - e.g. a marketing site that wants its own confirmation step first. */
|
|
456
|
+
onSelectPlan?: (plan: PublicPlan, price: PublicPlanPrice) => void;
|
|
457
|
+
children: React.ReactNode;
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Provider + layout root. Renders a skeleton while the catalog loads and an
|
|
461
|
+
* error panel if it fails, so `<PricingTable.Plan>` children only ever mount
|
|
462
|
+
* once real data exists - they never have to handle a "plan not loaded yet"
|
|
463
|
+
* state of their own.
|
|
464
|
+
*/
|
|
465
|
+
declare function PricingTable({ product, defaultLabel, checkoutSuccessUrl, checkoutCancelUrl, onSelectPlan, appearance, className, children, }: PricingTableProps): react_jsx_runtime.JSX.Element;
|
|
466
|
+
declare namespace PricingTable {
|
|
467
|
+
var LabelSwitch: () => react_jsx_runtime.JSX.Element | null;
|
|
468
|
+
var Plan: ({ slug, featured, badge, maxFeatures }: PricingTablePlanProps) => react_jsx_runtime.JSX.Element | null;
|
|
469
|
+
var Plans: ({ featuredSlug, featuredBadge, maxFeatures }: PricingTablePlansProps) => react_jsx_runtime.JSX.Element;
|
|
470
|
+
}
|
|
471
|
+
interface PricingTablePlanProps {
|
|
472
|
+
/** The plan to render - matched against `Plan.slug`. */
|
|
473
|
+
slug: string;
|
|
474
|
+
/** Visually distinguished (stronger border, soft elevation) - a host decision, never inferred from `is_default` (the free-tier fallback, not a "recommended" signal). */
|
|
475
|
+
featured?: boolean;
|
|
476
|
+
/** Eyebrow shown above the plan name, e.g. "Most popular". Only rendered when passed - no badge is invented from data. */
|
|
477
|
+
badge?: string;
|
|
478
|
+
/** Cap how many entitlements render before "+N more". Omit to show all. */
|
|
479
|
+
maxFeatures?: number;
|
|
480
|
+
}
|
|
481
|
+
interface PricingTablePlansProps {
|
|
482
|
+
/** Slug of the plan to visually feature - a host decision, see PricingTablePlanProps.featured. */
|
|
483
|
+
featuredSlug?: string;
|
|
484
|
+
/** Eyebrow on the featured plan, e.g. "Most popular". */
|
|
485
|
+
featuredBadge?: string;
|
|
486
|
+
maxFeatures?: number;
|
|
487
|
+
}
|
|
488
|
+
|
|
354
489
|
interface CheckoutResultProps extends KerneUIProps {
|
|
355
490
|
/** `cancel` renders the abandoned-checkout copy and skips polling entirely. */
|
|
356
491
|
outcome?: 'success' | 'cancel';
|
|
@@ -388,4 +523,4 @@ interface UpgradePromptProps extends Omit<KerneUIProps, 'logo'> {
|
|
|
388
523
|
}
|
|
389
524
|
declare function UpgradePrompt({ featureKey, requested, featureName, children, upgradeUrl, onUpgradeClick, upgradeLabel, title, description, hideWhileLoading, appearance, className, }: UpgradePromptProps): react_jsx_runtime.JSX.Element | null;
|
|
390
525
|
|
|
391
|
-
export { ActivateAccountForm, type ActivateAccountFormProps, AuthFlow, type AuthFlowProps, type AuthFlowStep, BillingSection, type BillingSectionProps, ChangePasswordForm, type ChangePasswordFormProps, CheckoutResult, type CheckoutResultProps, ForgotPasswordForm, type ForgotPasswordFormProps, type KerneAppearance, LoginForm, type LoginFormProps, MagicLinkCallback, type MagicLinkCallbackProps, ProfileSection, type ProfileSectionProps, RegisterForm, type RegisterFormProps, ResetPasswordForm, type ResetPasswordFormProps, SecuritySection, type SecuritySectionProps, SignOutButton, type SignOutButtonProps, SubscriptionCard, type SubscriptionCardProps, UpgradePrompt, type UpgradePromptProps, UsageMeters, type UsageMetersProps, UserButton, type UserButtonMenuItem, type UserButtonProps, UserProfile, type UserProfileExtraTab, type UserProfileProps, type UserProfileTab, VerifyEmailForm, type VerifyEmailFormProps, WaitlistForm, type WaitlistFormProps };
|
|
526
|
+
export { ActivateAccountForm, type ActivateAccountFormProps, AuthFlow, type AuthFlowProps, type AuthFlowStep, BillingSection, type BillingSectionProps, ChangePasswordForm, type ChangePasswordFormProps, CheckoutResult, type CheckoutResultProps, ForgotPasswordForm, type ForgotPasswordFormProps, type KerneAppearance, KerneLocalization, type LabelSavings, LoginForm, type LoginFormProps, MagicLinkCallback, type MagicLinkCallbackProps, type PriceDisplay, PricingTable, type PricingTablePlanProps, type PricingTablePlansProps, type PricingTableProps, ProfileSection, type ProfileSectionProps, RegisterForm, type RegisterFormProps, ResetPasswordForm, type ResetPasswordFormProps, SecuritySection, type SecuritySectionProps, SignOutButton, type SignOutButtonProps, SubscriptionCard, type SubscriptionCardProps, UpgradePrompt, type UpgradePromptProps, UsageMeters, type UsageMetersProps, UserButton, type UserButtonMenuItem, type UserButtonProps, UserProfile, type UserProfileExtraTab, type UserProfileProps, type UserProfileTab, VerifyEmailForm, type VerifyEmailFormProps, WaitlistForm, type WaitlistFormProps, collectPriceLabels, formatDate, formatInterval, formatMoney, formatNumber, humanizeFeatureKey, resolveLabelSavings, resolvePriceDisplay, usePricingTable };
|