Files
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

107 lines
2.9 KiB
TypeScript

import { BoxPlus } from 'icons'
import { Plus } from 'lucide-react'
import Link from 'next/link'
import {
Button,
Card,
Skeleton,
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow,
} from 'ui'
import { EmptyStatePresentational } from 'ui-patterns/EmptyStatePresentational'
import { ShimmeringCard } from './ShimmeringCard'
import { HomeIcon } from '@/components/layouts/Navigation/LayoutHeader/HomeIcon'
import { useIsFeatureEnabled } from '@/hooks/misc/useIsFeatureEnabled'
export const Header = () => {
return (
<div className="flex items-center border-default border-b px-4 py-3.5">
<HomeIcon />
</div>
)
}
export const LoadingTableView = () => {
return (
<Card>
<Table>
<TableHeader>
<TableRow>
<TableHead>Project</TableHead>
<TableHead>Status</TableHead>
<TableHead>Compute</TableHead>
<TableHead>Region</TableHead>
<TableHead>Created</TableHead>
</TableRow>
</TableHeader>
<TableBody>
{[...Array(3)].map((_, i) => (
<TableRow key={i}>
<TableCell>
<Skeleton className="bg-surface-400 h-4 w-32"></Skeleton>
</TableCell>
<TableCell>
<Skeleton className="bg-surface-400 h-4 w-16"></Skeleton>
</TableCell>
<TableCell>
<Skeleton className="bg-surface-400 h-4 w-20"></Skeleton>
</TableCell>
<TableCell>
<Skeleton className="bg-surface-400 h-4 w-20"></Skeleton>
</TableCell>
<TableCell>
<Skeleton className="bg-surface-400 h-4 w-24"></Skeleton>
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</Card>
)
}
export const LoadingCardView = () => {
return (
<ul className="w-full mx-auto grid grid-cols-1 gap-4 sm:grid-cols-1 md:grid-cols-1 lg:grid-cols-2 xl:grid-cols-3">
<ShimmeringCard />
<ShimmeringCard />
</ul>
)
}
export const NoProjectsState = ({ slug }: { slug: string }) => {
const projectCreationEnabled = useIsFeatureEnabled('projects:create')
return (
<EmptyStatePresentational
icon={BoxPlus}
title="Create a project"
description="Launch a complete backend built on Postgres."
>
{projectCreationEnabled && (
<Button size="tiny" asChild icon={<Plus />}>
<Link href={`/new/${slug}`}>New project</Link>
</Button>
)}
</EmptyStatePresentational>
)
}
export const NoOrganizationsState = () => {
return (
<EmptyStatePresentational
title="Create an organization"
description="Manage your team and projects in one place."
>
<Button size="tiny" variant="primary" asChild icon={<Plus />}>
<Link href="/new">New organization</Link>
</Button>
</EmptyStatePresentational>
)
}