Files
supabase/apps/www/components/Solutions/CtaSection.tsx
Danny White 476d4a5851 refactor(ui): drop redundant Button variant="default" props (#50161)
## What kind of change does this PR introduce?

Mechanical cleanup on top of the Button default-variant change (#50160).

## What is the current behavior?

Many callsites still pass `variant="default"` even though that is now
the component default.

## What is the new behavior?

Removes redundant static `variant="default"` from legacy `Button` and
`ButtonTooltip` callsites. Keeps explicit defaults where they document
the API:

- `button-default.tsx` and `button-sizes.tsx` demos
- `DocsButton`, which pins neutral styling at the wrapper boundary

## To test

Studio:

- [Auth → Rate
Limits](https://studio-staging-2s957kwc4-supabase.vercel.app/dashboard/project/_/auth/rate-limits):
dirty the form so Cancel appears; Cancel stays neutral, Save stays green
- [Project Settings → API
Keys](https://studio-staging-2s957kwc4-supabase.vercel.app/dashboard/project/_/settings/api-keys):
`DocsButton` in the header actions stays neutral

Design system:

- [Design system →
Button](https://design-system-git-dnywh-dc924ac1-supabase.vercel.app/design-system/docs/components/button):
`button-default` / `button-sizes` still show explicit default styling;
Primary (green) is restricted to the Primary section (and `asChild`)

WWW:

- [www → Brand
assets](https://zone-www-dot-com-git-dnywh-dc924ac1-supabase.vercel.app/brand-assets):
Download logo kit / Download button kit stay neutral
2026-09-11 17:05:26 +10:00

66 lines
1.7 KiB
TypeScript

import Link from 'next/link'
import React from 'react'
import { Button, cn } from 'ui'
import SectionContainer from '@/components/Layouts/SectionContainer'
export interface CtaSectionProps {
id: string
title: string | React.ReactNode
subtitle?: string
primaryCta: {
label: string
url: string
target?: string
icon?: React.ReactNode
}
secondaryCta?: {
label: string
url: string
}
image?: {
dark: string
light: string
}
className?: string
}
const CtaSection = ({
id,
title,
subtitle,
primaryCta,
secondaryCta,
className,
}: CtaSectionProps) => {
return (
<SectionContainer
id={id}
className={cn('py-16 md:py-24 lg:py-32 relative overflow-hidden', className)}
>
<div className="mx-auto relative z-10">
<div className="flex flex-col gap-6 text-center items-center max-w-5xl mx-auto">
<h2 className="text-foreground-light text-2xl lg:text-3xl leading-tight">{title}</h2>
{subtitle && <p className="text-foreground-light text-lg">{subtitle}</p>}
<div className="flex flex-wrap gap-3 pt-4">
<Button variant="primary" asChild size="medium" icon={primaryCta.icon}>
<Link href={primaryCta.url} target={primaryCta.target}>
{primaryCta.label}
</Link>
</Button>
{secondaryCta && (
<Button asChild size="medium">
<Link href={secondaryCta.url}>{secondaryCta.label}</Link>
</Button>
)}
</div>
</div>
</div>
<div className="absolute inset-0 w-full h-full bg-linear-to-r from-transparent via-transparent to-background opacity-80 z-0"></div>
</SectionContainer>
)
}
export default CtaSection