{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "pricing-section",
  "title": "Pricing Section",
  "description": "Plans, billing periods, limits, and purchase actions.",
  "dependencies": [
    "class-variance-authority",
    "lucide-react"
  ],
  "registryDependencies": [
    "badge",
    "button",
    "https://uaiblocks.dev/r/uai-theme.json",
    "https://uaiblocks.dev/r/pricing-toggle.json",
    "https://uaiblocks.dev/r/uai-utils.json"
  ],
  "files": [
    {
      "path": "src/registry/uai/blocks/pricing-section.tsx",
      "content": "\"use client\";\n\nimport { cva } from \"class-variance-authority\";\nimport { Check, Minus } from \"lucide-react\";\nimport { type ComponentProps, createContext, useContext, useId } from \"react\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\nimport { PricingToggle, type PricingToggleVariant } from \"@/components/ui/uai/pricing-toggle\";\nimport { cn } from \"@/lib/uai-utils\";\n\nexport const PRICING_SECTION_VARIANTS = [\"cards\", \"joined\", \"compact\"] as const;\nexport type PricingSectionVariant = (typeof PRICING_SECTION_VARIANTS)[number];\nexport type PricingSectionProps = Omit<ComponentProps<\"section\">, \"defaultValue\" | \"onChange\"> & {\n  variant?: PricingSectionVariant;\n  /** Selected billing period, shared with PricingToggleList and PricingTogglePrice children. */\n  value?: string;\n  defaultValue?: string;\n  onValueChange?: (value: string) => void;\n};\n\ntype SectionContext = { id: string; variant: PricingSectionVariant };\nconst Context = createContext<SectionContext | null>(null);\nfunction useSection(part: string) {\n  const context = useContext(Context);\n  if (!context) throw new Error(`${part} must be used within PricingSection`);\n  return context;\n}\ntype PlanContext = { id: string; featured: boolean };\nconst PlanContext = createContext<PlanContext | null>(null);\nfunction usePlan(part: string) {\n  const context = useContext(PlanContext);\n  if (!context) throw new Error(`${part} must be used within PricingSectionPlan`);\n  return context;\n}\n\nconst toggleVariants: Record<PricingSectionVariant, PricingToggleVariant> = {\n  cards: \"segmented\",\n  joined: \"pill\",\n  compact: \"compact\",\n};\n/** Plans, billing periods, limits, and purchase actions. The root owns the billing period through PricingToggle. */\nexport function PricingSection({\n  variant = \"cards\",\n  value,\n  defaultValue,\n  onValueChange,\n  className,\n  children,\n  ...props\n}: PricingSectionProps) {\n  const id = useId();\n  return (\n    <Context.Provider value={{ id, variant }}>\n      <section\n        aria-labelledby={`${id}-title`}\n        data-slot=\"pricing-section\"\n        className={cn(\"box-border min-w-0 text-[13px]/[18px] text-foreground\", className)}\n        {...props}\n        data-variant={variant}\n      >\n        <PricingToggle\n          variant={toggleVariants[variant]}\n          value={value}\n          defaultValue={defaultValue}\n          onValueChange={onValueChange}\n          className={variant === \"compact\" ? \"gap-5\" : \"gap-8\"}\n        >\n          {children}\n        </PricingToggle>\n      </section>\n    </Context.Provider>\n  );\n}\n\nexport function PricingSectionHeader({ className, ...props }: ComponentProps<\"header\">) {\n  return (\n    <header\n      data-slot=\"pricing-section-header\"\n      className={cn(\"mx-auto grid max-w-[600px] justify-items-center gap-3 text-center\", className)}\n      {...props}\n    />\n  );\n}\n\nexport function PricingSectionTitle({ className, ...props }: ComponentProps<\"h2\">) {\n  const { id, variant } = useSection(\"PricingSectionTitle\");\n  return (\n    <h2\n      data-slot=\"pricing-section-title\"\n      className={cn(\n        \"m-0 font-medium tracking-[-0.025em] text-balance\",\n        variant === \"compact\" ? \"text-[22px]/[1.15]\" : \"text-[30px]/[1.15]\",\n        className,\n      )}\n      {...props}\n      id={`${id}-title`}\n    />\n  );\n}\n\nexport function PricingSectionDescription({ className, ...props }: ComponentProps<\"p\">) {\n  return (\n    <p\n      data-slot=\"pricing-section-description\"\n      className={cn(\"m-0 text-[15px]/[23px] text-pretty text-muted-foreground\", className)}\n      {...props}\n    />\n  );\n}\n\nconst pricingSectionPlansVariants = cva(\"m-0 grid list-none p-0\", {\n  variants: {\n    variant: {\n      cards: \"grid-cols-[repeat(auto-fit,minmax(min(100%,220px),1fr))] gap-3\",\n      joined:\n        \"grid-cols-[repeat(auto-fit,minmax(min(100%,220px),1fr))] gap-px overflow-hidden rounded-[14px] border bg-border\",\n      compact: \"grid-cols-[repeat(auto-fit,minmax(min(100%,180px),1fr))] gap-2\",\n    },\n  },\n});\n\nexport function PricingSectionPlans({ className, ...props }: ComponentProps<\"ul\">) {\n  const { variant } = useSection(\"PricingSectionPlans\");\n  return (\n    <ul\n      data-slot=\"pricing-section-plans\"\n      className={cn(pricingSectionPlansVariants({ variant }), className)}\n      {...props}\n    />\n  );\n}\n\nexport type PricingSectionPlanProps = ComponentProps<\"li\"> & { featured?: boolean };\n\nconst pricingSectionPlanVariants = cva(\"box-border flex min-w-0 flex-col\", {\n  variants: {\n    variant: {\n      cards: \"gap-3.5 rounded-[14px] border p-5 shadow-[0_1px_2px_oklch(0_0_0/0.04)]\",\n      joined: \"gap-3.5 rounded-none border-0 p-5 shadow-none\",\n      compact: \"gap-2.5 rounded-xl border p-3.5 shadow-[0_1px_2px_oklch(0_0_0/0.04)]\",\n    },\n    featured: {\n      true: \"border-border-strong bg-[color-mix(in_oklab,var(--muted)_60%,var(--card))]\",\n      false: \"bg-card\",\n    },\n  },\n});\n\nexport function PricingSectionPlan({\n  featured = false,\n  className,\n  ...props\n}: PricingSectionPlanProps) {\n  const { variant } = useSection(\"PricingSectionPlan\");\n  const id = useId();\n  return (\n    <PlanContext.Provider value={{ id, featured }}>\n      <li\n        aria-labelledby={`${id}-name`}\n        data-slot=\"pricing-section-plan\"\n        className={cn(pricingSectionPlanVariants({ variant, featured }), className)}\n        {...props}\n        data-featured={featured || undefined}\n      />\n    </PlanContext.Provider>\n  );\n}\n\nexport function PricingSectionPlanName({ className, ...props }: ComponentProps<\"h3\">) {\n  const plan = usePlan(\"PricingSectionPlanName\");\n  return (\n    <h3\n      data-slot=\"pricing-section-plan-name\"\n      className={cn(\"m-0 flex flex-wrap items-center gap-2 text-sm/5 font-medium\", className)}\n      {...props}\n      id={`${plan.id}-name`}\n    />\n  );\n}\n\nexport function PricingSectionPlanBadge({ className, ...props }: ComponentProps<\"span\">) {\n  return (\n    <Badge\n      data-slot=\"pricing-section-plan-badge\"\n      className={cn(\n        \"h-5 rounded-full border-0 bg-primary/16 px-2 py-0 text-[11.5px]/4 text-primary-ink\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\nexport function PricingSectionPlanPrice({ className, ...props }: ComponentProps<\"p\">) {\n  const { variant } = useSection(\"PricingSectionPlanPrice\");\n  return (\n    <p\n      data-slot=\"pricing-section-plan-price\"\n      className={cn(\n        \"m-0 font-medium tracking-[-0.03em] tabular-nums\",\n        variant === \"compact\" ? \"text-[22px]/[1.1]\" : \"text-[30px]/[1.1]\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\nexport function PricingSectionPlanPeriod({ className, ...props }: ComponentProps<\"span\">) {\n  return (\n    <span\n      data-slot=\"pricing-section-plan-period\"\n      className={cn(\n        \"ml-1 text-[12px] font-normal tracking-normal text-subtle-foreground\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\nexport function PricingSectionPlanDescription({ className, ...props }: ComponentProps<\"p\">) {\n  return (\n    <p\n      data-slot=\"pricing-section-plan-description\"\n      className={cn(\"m-0 leading-[19px] text-pretty text-muted-foreground\", className)}\n      {...props}\n    />\n  );\n}\n\nexport function PricingSectionPlanFeatures({ className, ...props }: ComponentProps<\"ul\">) {\n  return (\n    <ul\n      data-slot=\"pricing-section-plan-features\"\n      className={cn(\n        \"m-0 grid list-none gap-[9px] border-t border-border/70 px-0 pt-3.5 pb-0.5\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\nexport type PricingSectionPlanFeatureProps = ComponentProps<\"li\"> & {\n  /** Set to false to show a limit the plan does not include. */\n  included?: boolean;\n};\n\nexport function PricingSectionPlanFeature({\n  included = true,\n  children,\n  className,\n  ...props\n}: PricingSectionPlanFeatureProps) {\n  const Icon = included ? Check : Minus;\n  return (\n    <li\n      data-slot=\"pricing-section-plan-feature\"\n      className={cn(\n        \"flex items-start gap-2\",\n        included ? \"text-foreground\" : \"text-subtle-foreground\",\n        className,\n      )}\n      {...props}\n      data-included={included}\n    >\n      <Icon\n        size={14}\n        strokeWidth={2}\n        aria-hidden=\"true\"\n        className={cn(\n          \"size-3.5\",\n          \"mt-0.5 flex-none\",\n          included ? \"text-muted-foreground\" : \"text-border-strong\",\n        )}\n      />\n      <span>\n        {included ? null : <span className=\"sr-only\">Not included: </span>}\n        {children}\n      </span>\n    </li>\n  );\n}\n\nconst pricingSectionPlanActionVariants = cva(\n  [\n    \"mt-auto gap-2 rounded-full px-3.5 py-0 no-underline has-[>svg]:px-3.5\",\n    \"transition-[filter,box-shadow,scale] duration-[120ms,120ms,140ms] ease-[ease-out,ease-out,cubic-bezier(0.23,1,0.32,1)]\",\n    \"focus-visible:ring-0 focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-2 focus-visible:outline-ring active:scale-97\",\n    \"motion-reduce:transition-none motion-reduce:active:scale-100\",\n  ],\n  {\n    variants: {\n      featured: {\n        true: \"bg-primary text-primary-foreground hover:bg-primary hover:brightness-108\",\n        false:\n          \"bg-secondary text-secondary-foreground hover:bg-secondary hover:shadow-[inset_0_0_0_999px_color-mix(in_oklab,var(--foreground)_9%,transparent)]\",\n      },\n      compact: { true: \"h-[30px] text-[12.5px]\", false: \"h-[34px] text-[13px]\" },\n    },\n  },\n);\n\n/** Purchase action. The featured plan uses the accent fill; other plans use a raised pill. */\nexport function PricingSectionPlanAction({ className, ...props }: ComponentProps<\"a\">) {\n  const plan = usePlan(\"PricingSectionPlanAction\");\n  const { variant } = useSection(\"PricingSectionPlanAction\");\n  return (\n    <Button\n      asChild\n      variant={plan.featured ? \"default\" : \"secondary\"}\n      className={cn(\n        pricingSectionPlanActionVariants({\n          featured: plan.featured,\n          compact: variant === \"compact\",\n        }),\n        className,\n      )}\n    >\n      <a\n        data-slot=\"pricing-section-plan-action\"\n        {...props}\n        data-emphasis={plan.featured ? \"primary\" : \"secondary\"}\n      />\n    </Button>\n  );\n}\n\nexport function PricingSectionFootnote({ className, ...props }: ComponentProps<\"p\">) {\n  return (\n    <p\n      data-slot=\"pricing-section-footnote\"\n      className={cn(\"m-0 text-center text-xs/4 text-subtle-foreground\", className)}\n      {...props}\n    />\n  );\n}\n",
      "type": "registry:component",
      "target": "@components/uai/pricing-section.tsx"
    }
  ],
  "categories": [
    "marketing",
    "pricing"
  ],
  "type": "registry:block"
}