Files
supabase/apps/www/pages/regions.tsx
Danny White ec53175b8a refactor(ui): rename text-brand to text-primary (#50564)
## What kind of change does this PR introduce?

Refactor. Follow-up to #49871.

## What is the current behavior?

Branded (green) text still uses the `text-brand` classname while the
colour comes from `--primary`.

## What is the new behavior?

**Rename-only:** `text-brand` → `text-primary` across callsites and
docs. Leftover `bg-brand` / `border-brand` alias to `brand-default`. No
intentional colour changes in this PR.

This better matches how we treat our green in other components and
props, like `variant="primary"` for green buttons.

## To test

On light mode: smoke-test that branded text still looks like #49871
(readable green, not the bright fill).

-
[Homepage](https://zone-www-dot-com-git-dnywh-depr-316-text-brand-de2380-supabase.vercel.app/):
“Scale to millions” uses `text-primary`
- [Docs
homepage](https://docs-git-dnywh-depr-316-text-brand-to-primary-supabase.vercel.app/docs):
branded links like “More on self-hosting” are still readable
- [Typography
docs](https://design-system-git-dnywh-depr-316-text-brand-to-primary-supabase.vercel.app/design-system/docs/typography):
documents `text-primary`
- [Colour
usage](https://design-system-git-dnywh-depr-316-text-brand-to-primary-supabase.vercel.app/design-system/docs/color-usage):
`text-primary` is visibly darker than `bg-brand-default` _on light mode_
- [Studio auth
providers](https://studio-staging-git-dnywh-depr-316-text-brand-to-60fa6c-supabase.vercel.app/dashboard/project/_/auth/providers):
enabled provider badge text readable; status dot stays bright green

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Style**
* Updated branded text, link hover states, icons, badges, indicators,
and highlighted content across the Design System, Docs, Studio, Learn,
UI Library, and marketing experiences to use the primary theme color.
* Updated syntax highlighting and table-of-contents styling for
consistent primary-color presentation.
  * Refined brand color fallback behavior for bright fills and borders.

* **Documentation**
* Updated color-usage and typography guidance to recommend the primary
text utility.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-22 16:19:03 +10:00

145 lines
5.5 KiB
TypeScript

import CTABanner from '~/components/CTABanner'
import DefaultLayout from '~/components/Layouts/Default'
import SectionContainer from '~/components/Layouts/SectionContainer'
import SectionHeading from '~/components/Layouts/SectionHeading'
import { DOCUMENTS, REGION_COUNT, RESIDENCY_ROWS } from '~/components/Regions/Regions.constants'
import { RegionsExplorer } from '~/components/Regions/RegionsExplorer'
import ProductHeaderCentered from '~/components/Sections/ProductHeaderCentered'
import { ArrowUpRight, FileText } from 'lucide-react'
import { NextSeo } from 'next-seo'
import Link from 'next/link'
import { useRouter } from 'next/router'
import { Badge } from 'ui'
import { Admonition } from 'ui-patterns/Admonition'
const RESIDENCY_BADGE_VARIANTS = {
'In region': 'success',
'Your choice': 'default',
Global: 'warning',
} as const
const RegionsPage = () => {
const router = useRouter()
const meta_title = 'Regions | Supabase'
const meta_description = `Host your project in any of ${REGION_COUNT} AWS regions. Postgres, Auth, and Storage objects stay in the region you choose.`
return (
<>
<NextSeo
title={meta_title}
description={meta_description}
openGraph={{
title: meta_title,
description: meta_description,
url: `https://supabase.com${router.pathname}`,
images: [
{
url: 'https://supabase.com/images/og/supabase-og.png',
},
],
}}
/>
<DefaultLayout>
<SectionContainer className="pb-0! md:pb-0! lg:pb-0!">
<ProductHeaderCentered
title="Available Regions"
h1={
<>
{REGION_COUNT} regions.
<br /> Pick the one you need.
</>
}
subheader="Your Postgres database, Auth service, and Storage objects stay in the region you choose."
cta={{ label: 'Start your project', link: 'https://supabase.com/dashboard/sign-up' }}
secondaryCta={{ label: 'Read the DPA', link: '/legal/dpa' }}
/>
</SectionContainer>
<SectionContainer className="flex flex-col gap-8 lg:gap-12">
<RegionsExplorer />
</SectionContainer>
<SectionContainer className="pt-0! flex flex-col gap-8 lg:gap-12">
<div className="flex flex-col gap-8">
<SectionHeading
title="What stays in your region"
description="How region choice affects your data residency."
/>
<div className="border-t border-muted">
{RESIDENCY_ROWS.map((row) => (
<div
key={row.component}
className="grid grid-cols-1 items-baseline gap-2 border-b border-muted py-4 md:grid-cols-[1.5fr_7rem_2fr] md:gap-6"
>
<span className="text-sm text-foreground">{row.component}</span>
<div className="flex items-baseline gap-3 md:contents">
<Badge
variant={RESIDENCY_BADGE_VARIANTS[row.status]}
className="shrink-0 justify-self-start"
>
{row.status}
</Badge>
<span className="text-sm text-foreground-light">{row.detail}</span>
</div>
</div>
))}
</div>
</div>
<Admonition type="caution" title="If you need the EU">
<p>Choose a specific region: Frankfurt, Ireland, or Paris.</p>
<p>
London or Zurich both have GDPR-adequacy regimes, but neither is an EU member state.
</p>
</Admonition>
</SectionContainer>
<SectionContainer className="pt-0! flex flex-col gap-8 lg:gap-12">
<SectionHeading
title="Documents"
description="Additional information about Supabase regions."
/>
<div className="grid grid-cols-1 gap-px overflow-hidden rounded-lg border bg-border sm:grid-cols-2">
{DOCUMENTS.map((doc) => {
const isExternal = doc.href.startsWith('http')
return (
<Link
key={doc.href}
href={doc.href}
className="group flex items-start gap-3 bg-background p-6 transition-colors hover:bg-surface-100"
>
<FileText size={16} className="mt-0.5 shrink-0 text-foreground-muted" />
<div className="flex flex-col gap-1">
<span className="flex items-center gap-1 text-sm text-foreground">
{doc.label}
{isExternal && (
<ArrowUpRight
size={14}
className="text-foreground-muted transition-transform group-hover:translate-x-0.5 group-hover:-translate-y-0.5"
/>
)}
</span>
<span className="text-sm text-foreground-lighter">{doc.description}</span>
</div>
</Link>
)
})}
</div>
<p className="text-sm text-foreground-light">
Need the database in your own cloud?{' '}
<Link href="/go/byoc-early-access" className="text-primary hover:underline">
Ask about early access to BYOC
</Link>
.
</p>
</SectionContainer>
<CTABanner />
</DefaultLayout>
</>
)
}
export default RegionsPage