import React from 'react'; export { WixMediaImage } from '@wix/headless-media/react'; import { AsChildChildren } from '@wix/headless-utils/react'; import { PlanServiceConfig } from '../services/index.js'; import { PlanData, NameData, DescriptionData, AdditionalFeesData, AdditionalFeeNameData, RecurrenceData, DurationData, PerksData, PerkItemData, FreeTrialDaysData } from './core/Plan.js'; import { WixMediaImage } from '@wix/headless-media/react'; import { Commerce } from '@wix/headless-ecom/react'; import { MoneyProps } from '@wix/headless-components/react'; interface RootProps { planServiceConfig: PlanServiceConfig; children: React.ReactNode; } /** * The root container that provides plan context to child components * * @component * @example * ```tsx * * * * * * * * * * * * ``` */ export declare const Root: ({ planServiceConfig, children }: RootProps) => import("react/jsx-runtime").JSX.Element; interface PlanProps { asChild?: boolean; children: AsChildChildren | React.ReactNode; className?: string; loadingState?: React.ReactNode; } /** * Displays the plan data with support for loading state * * @component * @example * ```tsx * // Default usage * Loading...}> * * * * * // With asChild * * {React.forwardRef(({isLoading, error, plan}, ref) => { * if (isLoading) { * return
Loading...
; * } * if (error) { * return
Error!
; * } * return ( *
* Plan {plan.name} *
* ); * })} *
* */ export declare const Plan: React.ForwardRefExoticComponent>; type ImageProps = Omit, 'src' | 'media'>; /** * Displays the plan image using WixMediaImage * * @component * @example * ```tsx * // Default usage * * * // asChild with primitive * * * * * // asChild with react component * * {React.forwardRef(({src, ...props}, ref) => ( * * ))} * * ``` */ export declare const Image: React.ForwardRefExoticComponent & React.RefAttributes>; export type PlanNameData = NameData; interface NameProps { asChild?: boolean; children?: AsChildChildren; className?: string; } /** * Displays the plan name. * * @component * @example * ```tsx * // Default usage * * * // asChild with primitive * *

* * * // asChild with react component * * {React.forwardRef(({name, ...props}, ref) => ( *

* {name} *

* ))} *
* ``` */ export declare const Name: React.ForwardRefExoticComponent>; export type PlanDescriptionData = DescriptionData; interface DescriptionProps { asChild?: boolean; children?: AsChildChildren; className?: string; } /** * Displays the plan description. * * @component * @example * ```tsx * // Default usage * * * // asChild with primitive * *

* * * // asChild with react component * * {React.forwardRef(({description, ...props}, ref) => ( *

* {description} *

* ))} *
* ``` */ export declare const Description: React.ForwardRefExoticComponent>; export type PlanPriceData = { amount: number; currency: string; formattedMoney: string; formattedMoneyParts: Intl.NumberFormatPart[]; }; interface PriceProps { asChild?: boolean; children?: MoneyProps['children']; className?: string; } /** * Displays the plan price. * * @component * @example * ```tsx * // Default usage * * * // asChild with primitive * * * * * // asChild with react component * * {React.forwardRef(({amount, currency, formattedMoney, formattedMoneyParts, ...props}, ref) => ( * * {price.formattedMoney} *
*
* {amount} {currency} *
* ))} *
* ``` */ export declare const Price: React.ForwardRefExoticComponent>; export type PlanAdditionalFeesData = AdditionalFeesData; interface AdditionalFeesProps { asChild?: boolean; children: AsChildChildren; className?: string; } /** * Container for plan additional fees. * * @component * @example * ```tsx * // Default usage * * * * * * * * // asChild with react component * * {React.forwardRef(({additionalFees, ...props}, ref) => ( *
* {additionalFees.length > 0 && 'Additional fees apply'} *
* ))} *
* ``` */ export declare const AdditionalFees: React.ForwardRefExoticComponent>; interface AdditionalFeesRepeaterProps { children: React.ReactNode; } /** * Repeater component that renders children for each additional fee with the additional fee context. * * @component * @example * ```tsx * * * * * ``` */ export declare const AdditionalFeesRepeater: ({ children, }: AdditionalFeesRepeaterProps) => import("react/jsx-runtime").JSX.Element; export type PlanAdditionalFeeNameData = AdditionalFeeNameData; interface AdditionalFeeNameProps { asChild?: boolean; children?: AsChildChildren; className?: string; } /** * Displays the additional fee name. Must be used within an AdditionalFeesRepeater. * * @component * @example * ```tsx * // Default usage * * * // asChild with primitive * * * * * // asChild with react component * * {React.forwardRef(({name, ...props}, ref) => ( * * {name} * * ))} * * ``` */ export declare const AdditionalFeeName: React.ForwardRefExoticComponent>; export type PlanAdditionalFeeAmountData = { amount: number; currency: string; formattedMoney: string; formattedMoneyParts: Intl.NumberFormatPart[]; }; interface AdditionalFeeAmountProps { asChild?: boolean; children?: MoneyProps['children']; className?: string; } /** * Displays the additional fee amount. Must be used within an AdditionalFeesRepeater. * * @component * @example * ```tsx * // Default usage * * * // asChild with primitive * * * * * // asChild with react component * * {React.forwardRef(({amount, currency, formattedMoney, formattedMoneyParts, ...props}, ref) => ( * * {amount} {currency} *
*
* {formattedFee} *
* ))} *
* ``` */ export declare const AdditionalFeeAmount: React.ForwardRefExoticComponent>; export type PlanRecurrenceData = RecurrenceData; interface RecurrenceProps { children: React.ForwardRefExoticComponent; } /** * Provides the child component with the recurrence data. It will be null for one-time plans. * * @component * @example * ```tsx * * {React.forwardRef(({ recurrence }, ref) => { * if (!recurrence) return null; * * return * Renews every {recurrence.count} {recurrence.period}(s) * * })} * * ``` */ export declare const Recurrence: React.ForwardRefExoticComponent>; export type PlanDurationData = DurationData; interface DurationProps { children: React.ForwardRefExoticComponent; } /** * Provides the child component with the duration data. It will be null for unlimited plans. * * @component * @example * ```tsx * * {React.forwardRef(({ duration }, ref) => { * if (!duration) return Valid until canceled; * * return * Valid for {duration.count} {duration.period}(s) * * })} * * ``` */ export declare const Duration: React.ForwardRefExoticComponent>; export type PlanFreeTrialDaysData = FreeTrialDaysData; interface FreeTrialDaysProps { children: React.ForwardRefExoticComponent; } /** * Displays the free trial days. * * @component * @example * ```tsx * * {React.forwardRef(({ freeTrialDays }, ref) => { * return * Free trial for {freeTrialDays} days * * })} * * ``` */ export declare const FreeTrialDays: React.ForwardRefExoticComponent>; export type PlanPerksData = PerksData; interface PerksProps { asChild?: boolean; children: AsChildChildren; className?: string; } /** * Container for plan perks. * * @component * @example * ```tsx * // Default usage * * * * * * * // asChild with react component * * {React.forwardRef(({perks, ...props}, ref) => ( *
* {perks.map((perk) => 🎉 {perk})} *
* ))} *
* ``` */ export declare const Perks: React.ForwardRefExoticComponent>; interface PerksRepeaterProps { children: React.ReactNode; } /** * Repeater component that renders children for each perk with the perk item context. * * @component * @example * ```tsx * * * * ``` */ export declare const PerksRepeater: ({ children }: PerksRepeaterProps) => import("react/jsx-runtime").JSX.Element; export type PlanPerkItemData = PerkItemData; interface PerkItemProps { asChild?: boolean; children?: AsChildChildren; className?: string; } /** * Displays the perk item. Must be used within a PerksRepeater. * * @component * @example * ```tsx * // Default usage * * * // asChild with primitive * * * * * // asChild with react component * * {React.forwardRef(({perk, ...props}, ref) => ( * * {perk} * * ))} * * ``` */ export declare const PerkItem: React.ForwardRefExoticComponent>; type ActionBuyNowProps = Omit; export declare const Action: { BuyNow: React.ForwardRefExoticComponent>; };