Files
supabase/apps/www/components/ProductIcon.tsx
anthony lio b1d59e0ee8 feat(www): pricing (#53320)
## Problem

- pricing page shows checks in the bright brand green
- pro button sits lower than the other plan buttons, and each price sits
lower than its plan name
- compute slider has no step marks, so a reader cannot see the sizes
before a drag

## Solution

- changes the plan cards so names, prices and buttons line up, and the
pro card has the only green button
- replaces the bright green check circles with tinted checks and drawn
minus icons, so both icons pass contrast
- adds step marks and a hover preview to the compute slider, so the
badge and price show a size before the click
- adds a tab above the micro row in the compute table, so readers see
which size the plan credits cover
- fixes the spend cap chart, which showed the bars of both states on
toggle because css transitions changed the motion values

| before | after |
|
---------------------------------------------------------------------------
|
--------------------------------------------------------------------------
|
| <img width="2880" height="23304" alt="pricing-before"
src="https://github.com/user-attachments/assets/c42c7487-e0fb-4914-a210-844fe67015bd"
/> | <img width="2880" height="22958" alt="pricing"
src="https://github.com/user-attachments/assets/e2066006-f610-4c53-a5a7-94525966fefc"
/> |

## Preview links

| Site | Live | Preview |
| ---- |
------------------------------------------------------------------------------------
| --- |
| WWW | [/pricing](https://supabase.com/pricing) |
[/pricing](https://zone-www-dot-com-git-antlio-feat-www-pricing-supabase.vercel.app/pricing)
|

## Review instructions

1. visit
[/pricing](https://zone-www-dot-com-git-antlio-feat-www-pricing-supabase.vercel.app/pricing)
2026-11-20 07:54:40 +02:00

67 lines
2.0 KiB
TypeScript

type Color = 'black' | 'gray' | 'green' | 'alt'
interface ProductIcon {
icon: string
color?: Color
}
function ProductIcon({ icon, color }: ProductIcon) {
const handleColor = (color: Color) => {
switch (color) {
case 'green':
return {
container: 'bg-brand-600 text-brand-100',
svg: 'stroke-brand-default',
}
case 'alt':
return {
container: 'bg-brand-200 text-primary',
svg: 'stroke-brand-default',
}
case 'gray':
return {
container: 'bg- text-primary',
svg: 'stroke-brand-default',
}
case 'black':
default:
return {
container: 'bg-foreground text-background-alternative',
svg: 'stroke-background',
}
}
}
return (
<div
className={[
'inline-flex shrink-0 items-center justify-center',
color === 'green' ? 'size-6 rounded-sm' : 'h-8 w-8 rounded-md',
!color || color === 'black' ? 'bg-foreground text-background-alternative' : '',
color && color === 'gray' ? 'bg-border-strong text-foreground-light' : '',
color && color === 'green' ? 'bg-primary/10 text-primary' : '',
color && color === 'alt' ? 'bg-alternative text-primary' : '',
// color && color === 'alt' ? 'bg-surface-300 text-primary' : '',
].join(' ')}
>
<svg
className={[
color === 'green' ? 'size-4' : 'h-5 w-5',
!color || color === 'black' ? 'stroke-background' : '',
color && color === 'gray' ? 'stroke-foreground-light' : '',
color && color === 'green' ? 'stroke-primary' : '',
color && color === 'alt' ? 'stroke-brand-default' : '',
].join(' ')}
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
aria-hidden="true"
>
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.5" d={icon} />
</svg>
</div>
)
}
export default ProductIcon