- Apparence : auto, clair ou sombre seulement ; Nuit et Étoilé sont relus comme sombre - Accent ambre fixe, défini dans le CSS (plus foncé en clair pour rester lisible) ; la section « Couleur d'accent » des réglages et ses textes disparaissent - Une seule police, Inter (titres en gras), à la place de Gloock / Onest / Sometype Mono Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVo1qxKoBQCaMd7Ue8PGbe
83 lines
3.2 KiB
TypeScript
83 lines
3.2 KiB
TypeScript
import type { ReactNode } from 'react'
|
|
import { cx } from '../lib/utils'
|
|
|
|
/** En-tête de page : titre en gras. La partie « accent » n'est colorée que pour le logo (wordmark). */
|
|
export function PageHeader({ title, accent, subtitle, action, wordmark }: { title: string; accent?: string; subtitle?: string; action?: ReactNode; wordmark?: boolean }) {
|
|
return (
|
|
<header className="flex items-end justify-between gap-3 pb-5 pt-7">
|
|
<div className="min-w-0">
|
|
<h1 className={cx('leading-[1.05]', wordmark ? 'text-[2rem] tracking-[-0.02em]' : 'text-[1.9rem]')}>
|
|
{title}
|
|
{accent && <span className={wordmark ? 'text-accent' : undefined}>{accent}</span>}
|
|
</h1>
|
|
{subtitle && <p className="mt-1.5 text-sm text-ink-3">{subtitle}</p>}
|
|
</div>
|
|
{action}
|
|
</header>
|
|
)
|
|
}
|
|
|
|
export function StatTile({ label, value, hint, className }: { label: string; value: ReactNode; hint?: string; className?: string }) {
|
|
return (
|
|
<div className={cx('card p-4', className)}>
|
|
<div className="eyebrow">{label}</div>
|
|
<div className="mt-2 font-bold text-[1.85rem] leading-none tabular-nums">{value}</div>
|
|
{hint && <div className="mt-2 text-xs text-ink-3">{hint}</div>}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
/** Titre de section : gras, sans capitales ni filet. */
|
|
export function SectionTitle({ children, action }: { children: ReactNode; action?: ReactNode }) {
|
|
return (
|
|
<div className="mb-3.5 mt-10 flex items-baseline justify-between gap-3">
|
|
<h2 className="text-[1.3rem] leading-tight text-ink">{children}</h2>
|
|
{action}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
/**
|
|
* Progression en pellicule : une image par épisode (regroupées au-delà de 40), perforations en haut et en bas.
|
|
* La pellicule reste sombre dans tous les thèmes ; les images vues prennent l'accent.
|
|
*/
|
|
export function FilmStrip({ done, total, label, className }: { done: number; total: number; label?: string; className?: string }) {
|
|
if (!total) return null
|
|
const frames = Math.min(total, 40)
|
|
const lit = Math.round((Math.min(done, total) / total) * frames)
|
|
return (
|
|
<div
|
|
role="progressbar"
|
|
aria-valuemin={0}
|
|
aria-valuemax={total}
|
|
aria-valuenow={Math.min(done, total)}
|
|
aria-label={label}
|
|
className={cx('film-strip', className)}
|
|
>
|
|
<div className="grid h-full gap-[2px]" style={{ gridTemplateColumns: `repeat(${frames}, minmax(0, 1fr))` }}>
|
|
{Array.from({ length: frames }, (_, k) => (
|
|
<i key={k} className={k < lit ? 'bg-accent-fill' : 'bg-film-frame'} />
|
|
))}
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export function LinkArrow({ onClick, children }: { onClick: () => void; children: ReactNode }) {
|
|
return (
|
|
<button onClick={onClick} className="shrink-0 text-sm font-medium text-ink-2 underline-offset-4 transition-colors hover:text-ink hover:underline">
|
|
{children}
|
|
</button>
|
|
)
|
|
}
|
|
|
|
export function EmptyState({ title, text, action }: { title: string; text?: string; action?: ReactNode }) {
|
|
return (
|
|
<div className="card mt-4 flex flex-col items-center px-6 py-12 text-center">
|
|
<p className="font-bold text-[1.5rem] leading-tight">{title}</p>
|
|
{text && <p className="mt-2 max-w-xs text-sm text-ink-2">{text}</p>}
|
|
{action && <div className="mt-6">{action}</div>}
|
|
</div>
|
|
)
|
|
}
|