Files
supabase/apps/studio/components/interfaces/Integrations/Landing/IntegrationCard.tsx
T
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

114 lines
4.0 KiB
TypeScript

import { BadgeCheck } from 'lucide-react'
import Image from 'next/image'
import Link from 'next/link'
import { Badge, Card, CardContent, cn } from 'ui'
import { ShimmeringLoader } from 'ui-patterns/ShimmeringLoader'
import { IntegrationDefinition } from './Integrations.constants'
import { useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject'
type IntegrationCardProps = IntegrationDefinition & {
isInstalled?: boolean
featured?: boolean
image?: string
}
const INTEGRATION_CARD_STYLE = cn(
'w-full h-full bg-surface-100 hover:bg-surface-200 hover:border-strong',
'border border-border rounded-md ease-out duration-200 transition-all'
)
export const IntegrationLoadingCard = () => {
return (
<div className={cn(INTEGRATION_CARD_STYLE, 'pl-5 pr-6 py-3 gap-3 inline-flex h-[110px]')}>
<div className="w-10 h-10 relative">
<ShimmeringLoader className="w-full h-full bg-foreground-light border rounded-md" />
</div>
<div className="grow basis-0 w-full flex flex-col justify-between items-start gap-y-2">
<div className="w-full flex-col justify-start items-start gap-y-1 flex">
<ShimmeringLoader className="w-3/4 py-2.5" />
<ShimmeringLoader className="w-full py-2.5" />
</div>
</div>
</div>
)
}
export const IntegrationCard = ({
id,
listingId,
status,
name,
icon,
description,
isInstalled,
featured = false,
image,
}: IntegrationCardProps) => {
const { data: project } = useSelectedProjectQuery()
const shouldShowOfficialBadge = !listingId
if (featured) {
return (
<Link href={`/project/${project?.ref}/integrations/${id}/overview`} className="h-full">
<Card className="h-full">
{/* Full-width image/icon at the top */}
<div className="w-full h-24 bg-surface-400 rounded-t-md flex items-center justify-center overflow-hidden relative">
{image ? (
<Image
fill
src={image}
alt={`${name} integration`}
className="w-full h-full object-cover"
/>
) : (
<div className="w-12 h-12 text-foreground relative">
{icon({ className: 'w-full h-full text-foreground' })}
</div>
)}
</div>
<CardContent className="p-6 px-4">
<div className="flex-col justify-start items-center text-center gap-y-0.5 flex">
<h3>{name}</h3>
<p className="text-foreground-light text-sm line-clamp-3">{description}</p>
<div className="flex items-center gap-x-1 mt-4">
{status && <Badge variant="warning">{status}</Badge>}
{shouldShowOfficialBadge && <Badge>Official</Badge>}
</div>
</div>
</CardContent>
</Card>
</Link>
)
}
return (
<Link href={`/project/${project?.ref}/integrations/${id}/overview`} className="h-full">
<Card className="h-full">
<CardContent className="flex flex-col p-4 @2xl:p-6 h-full">
<div className="flex items-start justify-between mb-4">
<div className="shrink-0 w-10 h-10 relative bg-white border rounded-md flex items-center justify-center">
{icon()}
</div>
{isInstalled && (
<div className="flex items-center gap-x-1">
<BadgeCheck size={14} className="text-primary" />
<span className="text-primary text-xs">Installed</span>
</div>
)}
</div>
<div className="flex-col justify-start items-start gap-y-0.5 flex flex-1">
<h3 className="text-foreground text-sm">{name}</h3>
<p className="text-foreground-light text-xs flex-1">{description}</p>
<div className="flex items-center gap-x-1 mt-4">
{status && <Badge variant="warning">{status}</Badge>}
{shouldShowOfficialBadge && <Badge>Official</Badge>}
</div>
</div>
</CardContent>
</Card>
</Link>
)
}