"use client"; import "./components/ui/tidal.css"; import { useId, useMemo, useState } from "react"; import { TidalPricingPageTemplate } from "./components/ui/pricing-page-template"; import type { TidalPricingBillingOption, TidalPricingPlan } from "./components/ui/pricing-section"; import type { TidalComparisonColumn, TidalComparisonFeature } from "./components/ui/feature-comparison-table"; import type { TidalFaqGroup } from "./components/ui/faq-section"; import "./components/ui/pricing-section.css"; import "./components/ui/feature-comparison-table.css"; import "./components/ui/faq-section.css"; import "./components/ui/pricing-page-template.css"; import "./components/ui/navigation-bar.css"; import "./components/ui/accordion.css"; import "./components/ui/call-to-action-section.css"; import "./components/ui/footer.css"; const BILLING_OPTIONS: readonly TidalPricingBillingOption[] = [ { id: "monthly", label: "Monthly", period: "Sample monthly display" }, { id: "annual", label: "Annual", period: "Sample yearly display" }, ]; const PLANS: readonly TidalPricingPlan[] = [ { id: "starter", name: "Starter", description: "A small fictional workspace for up to three sample projects.", prices: { monthly: { amount: "$18", period: "per month", note: "Sample USD" }, annual: { amount: "$15", period: "per month", note: "$180 sample yearly", }, }, features: [ { id: "projects", label: "Project workspace", included: true }, { id: "review", label: "Review notes", included: true }, { id: "history", label: "Extended history", included: false }, ], action: { label: "Select Starter sample", type: "button" }, }, { id: "team", name: "Team", description: "A fictional shared workspace with unlimited sample projects and more review context.", prices: { monthly: { amount: "$32", period: "per month", note: "Sample USD" }, annual: { amount: "$27", period: "per month", note: "$324 sample yearly", }, }, features: [ { id: "projects", label: "Project workspace", included: true }, { id: "review", label: "Review notes", included: true }, { id: "history", label: "Extended history", included: true }, ], action: { label: "Select Team sample", type: "button" }, badge: "Sample featured", featured: true, }, ]; const COMPARISON_FEATURES: readonly TidalComparisonFeature[] = [ { id: "projects", label: "Sample projects", description: "Visible local project entries.", values: { starter: { kind: "text", value: "3" }, team: { kind: "text", value: "Unlimited sample" }, }, }, { id: "review", label: "Review notes", values: { starter: { kind: "available" }, team: { kind: "available" }, }, }, { id: "history", label: "Extended history", values: { starter: { kind: "unavailable" }, team: { kind: "available" }, }, }, ]; const FAQ_GROUPS: readonly TidalFaqGroup[] = [ { id: "plans", label: "Sample plans", questions: [ { value: "sample-only", title: "Can I buy a plan from this preview?", searchText: "buy checkout payment purchase", answer: "No. The prices and plan choices are fictional display data. This preview has no checkout or payment connection.", }, { value: "billing-toggle", title: "What does the billing switch change?", searchText: "monthly annual billing switch", answer: "It changes the supplied local price strings and comparison context only.", }, ], }, { id: "workspace", label: "Workspace", questions: [ { value: "workspace-created", title: "Does selecting a plan create a workspace?", searchText: "workspace account create", answer: "No. Selection updates local React state and a visible sample message only.", }, ], }, ]; export interface PricingPageTemplateDemoProps { theme?: "light" | "dark"; } export function PricingPageTemplateDemo({ theme = "light", }: PricingPageTemplateDemoProps) { const instanceId = useId().replace(/:/g, ""); const topId = `pricing-sample-top-${instanceId}`; const plansId = `pricing-sample-plans-${instanceId}`; const comparisonId = `pricing-sample-comparison-${instanceId}`; const questionsId = `pricing-sample-questions-${instanceId}`; const nextStepId = `pricing-sample-next-step-${instanceId}`; const [billing, setBilling] = useState("monthly"); const [selectedPlan, setSelectedPlan] = useState(null); const [openQuestion, setOpenQuestion] = useState(""); const [message, setMessage] = useState( "Monthly sample prices are visible. No plan is selected.", ); const comparisonColumns = useMemo( () => PLANS.map((plan) => ({ id: plan.id, label: plan.name, accessibleLabel: `${plan.name} sample plan`, description: `${plan.prices[billing]?.amount ?? ""} sample ${billing}`, badge: plan.badge, action: { id: `${plan.id}-link`, kind: "link" as const, href: `#${plansId}`, label: `Review ${plan.name}`, accessibleLabel: `Review the ${plan.name} sample plan`, variant: plan.featured ? ("primary" as const) : undefined, }, })), [billing, plansId], ); function resetSample() { setBilling("monthly"); setSelectedPlan(null); setOpenQuestion(""); setMessage("The pricing sample returned to its initial state."); } return ( { setBilling(option.id); setMessage(`${option.label} sample prices are visible.`); }, selectedPlanId: selectedPlan, onSelectedPlanChange: (plan) => setSelectedPlan(plan.id), onPlanSelect: (plan, option) => setMessage( `${plan.name} is selected with ${option.label.toLowerCase()} sample pricing. No order was created.`, ), }} comparison={{ title: "Compare the supplied features", eyebrow: null, description: "Read each fictional plan column against the same feature rows.", caption: "Starter and Team sample plan comparison", columns: comparisonColumns, features: COMPARISON_FEATURES, }} faq={{ title: "Pricing questions", eyebrow: null, description: "Open a concise answer about this local sample.", groups: FAQ_GROUPS, value: openQuestion, onValueChange: setOpenQuestion, summaryHint: "Open a supplied question to inspect its answer.", }} callToAction={{ title: "Review the sample before connecting commerce.", eyebrow: "Next step", description: "Return to the plan cards or reset every local choice.", detailLabel: "Current selection", detail: selectedPlan ? `${selectedPlan === "team" ? "Team" : "Starter"}, ${billing}` : "No sample plan selected", actions: [ { id: "plans", kind: "link", href: `#${plansId}`, label: "Review sample plans", variant: "primary", }, { id: "reset", kind: "button", label: "Reset page sample", onAction: resetSample, }, ], footer: "No checkout, payment, subscription, or account action is connected.", }} footer={{ brand: Northstar, description: "A fictional pricing page sample.", groups: [ { id: "pricing", title: "Pricing", links: [ { href: `#${plansId}`, label: "Plans" }, { href: `#${comparisonId}`, label: "Comparison" }, ], }, { id: "page", title: "Page", links: [ { href: `#${questionsId}`, label: "Questions" }, { href: `#${topId}`, label: "Back to top" }, ], }, ], legal: Fictional sample pricing for local review., }} sampleNote={{message}} /> ); } export default function AgentExample() { return (
); }