Files
supabase/apps/www/app/state-of-startups/components/StateOfStartupsHeader.tsx
Saxon FletcherandClaude Opus 4.8 fb02182e86 Color system (#47288)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES/NO

## What kind of change does this PR introduce?

Bug fix, feature, docs update, ...

## What is the current behavior?

Please link any relevant issues here.

## What is the new behavior?

Feel free to include screenshots if it includes visual changes.

## Additional context

Add any other context or screenshots.


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

* **New Features**
* Refreshed theming across the UI to use modern color expressions and
shared theme variables (including OKLCH-based gradients), improving
consistency for charts, code blocks, overlays, icons, and decorative
backgrounds.
* **Bug Fixes**
* Improved light/dark color and gradient consistency across axis/grid
styling, reference lines, buttons/badges, sidebar accents, loaders, and
other visual components.
* **Documentation**
* Updated styling/theming guidance to align with the revised semantic
token system and the updated theme variable usage patterns.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-03 15:00:43 +10:00

137 lines
3.5 KiB
TypeScript

import { useMemo } from 'react'
import { ProgressBar } from './DecorativeProgressBar'
interface StateOfStartupsHeaderProps {
showProgressBars?: boolean
}
const DiagonalStripes = () => (
<div
className="grow"
style={{
backgroundImage: `repeating-linear-gradient(
45deg,
var(--border-muted) 0px,
var(--border-muted) 1px,
transparent 1px,
transparent 8px
)`,
}}
/>
)
const HeaderProgressBar = ({
delay = 0,
progressBgColor = 'bg-foreground-muted/80',
progressFgColor,
}: {
delay?: number
progressBgColor?: string
progressFgColor?: string
}) => (
<div className="grow">
<ProgressBar
className="h-full"
backgroundClassName={progressBgColor}
foregroundClassName={progressFgColor}
animationDelay={`${delay}s`}
/>
</div>
)
interface TextBlockProps {
text: string
bgColor: string
textColor: string
showProgressBar?: boolean
}
const TextBlock = ({
text,
bgColor,
textColor,
showProgressBar = true,
delay = 0,
progressBgColor,
progressFgColor,
}: TextBlockProps & { delay?: number; progressBgColor?: string; progressFgColor?: string }) => (
<div className="flex w-full items-stretch">
<div className={`inline-block ${bgColor}`}>
<span
className={`${textColor} text-[2rem] md:text-[4rem] px-2.5 md:px-8 py-1.5 md:py-3 inline-block leading-none tracking-tight`}
>
{text}
</span>
</div>
{showProgressBar ? (
<HeaderProgressBar
delay={delay}
progressBgColor={progressBgColor}
progressFgColor={progressFgColor}
/>
) : (
<DiagonalStripes />
)}
</div>
)
export function StateOfStartupsHeader({ showProgressBars = true }: StateOfStartupsHeaderProps) {
// Generate stable random delays between 0.2 and 2 seconds for each TextBlock
const randomDelays = useMemo(
() => [
0.2 + Math.random() * 1.8,
0.2 + Math.random() * 1.8,
0.2 + Math.random() * 1.8,
0.2 + Math.random() * 1.8,
],
[]
)
return (
<header className="mt-16 md:mt-32">
<div className="max-w-240 ml-8 md:mx-auto">
<div className="flex flex-col">
<h1 className="sr-only">State of Startups 2026</h1>
<TextBlock
text="State"
bgColor="bg-brand-400"
textColor="text-white"
showProgressBar={showProgressBars}
delay={randomDelays[0]}
progressBgColor="bg-surface-400 dark:bg-surface-300"
progressFgColor="bg-brand-300"
/>
<TextBlock
text="of"
bgColor="bg-brand-500"
textColor="text-brand-200"
showProgressBar={showProgressBars}
delay={randomDelays[1]}
progressBgColor="bg-surface-400 dark:bg-surface-300"
progressFgColor="bg-brand-300"
/>
<TextBlock
text="Startups"
bgColor="bg-brand-500"
textColor="text-white"
showProgressBar={showProgressBars}
delay={randomDelays[2]}
progressBgColor="bg-surface-400 dark:bg-surface-300"
progressFgColor="bg-brand-500"
/>
<TextBlock
text="2026"
bgColor="bg-brand-600"
textColor="text-brand-200"
showProgressBar={showProgressBars}
delay={randomDelays[3]}
progressBgColor="bg-surface-400 dark:bg-surface-300"
progressFgColor="bg-brand-600"
/>
</div>
</div>
</header>
)
}