design: two-color palette — rename all tokens to --cream / --blue
Replace ochre-clay, carbon-black, burnt-oxide, slate-indigo with clean two-color system: --cream (#f4f0e8) and --blue (#041cf3). Update every component, utility class, and test assertion.
This commit is contained in:
@@ -13,17 +13,13 @@ describe('Card', () => {
|
||||
});
|
||||
});
|
||||
describe('background variants', () => {
|
||||
it('defaults to ochre background', () => {
|
||||
it('defaults to cream background', () => {
|
||||
const { container } = render(<Card>Content</Card>);
|
||||
expect(container.firstChild).toHaveClass('bg-ochre-clay');
|
||||
expect(container.firstChild).toHaveClass('bg-cream');
|
||||
});
|
||||
it('applies slate background', () => {
|
||||
const { container } = render(<Card background="slate">Content</Card>);
|
||||
expect(container.firstChild).toHaveClass('bg-slate-indigo');
|
||||
});
|
||||
it('applies white background', () => {
|
||||
const { container } = render(<Card background="white">Content</Card>);
|
||||
expect(container.firstChild).toHaveClass('bg-white');
|
||||
it('applies blue background', () => {
|
||||
const { container } = render(<Card background="blue">Content</Card>);
|
||||
expect(container.firstChild).toHaveClass('bg-blue');
|
||||
});
|
||||
});
|
||||
describe('padding', () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { ReactNode } from 'react';
|
||||
import { cn } from '$shared/lib';
|
||||
|
||||
export type CardBackground = 'ochre' | 'slate' | 'white';
|
||||
export type CardBackground = 'cream' | 'blue';
|
||||
|
||||
interface CardProps {
|
||||
/**
|
||||
@@ -14,7 +14,7 @@ interface CardProps {
|
||||
className?: string;
|
||||
/**
|
||||
* Background color preset
|
||||
* @default 'ochre'
|
||||
* @default 'cream'
|
||||
*/
|
||||
background?: CardBackground;
|
||||
/**
|
||||
@@ -25,15 +25,14 @@ interface CardProps {
|
||||
}
|
||||
|
||||
const BG: Record<CardBackground, string> = {
|
||||
ochre: 'bg-ochre-clay',
|
||||
slate: 'bg-slate-indigo text-ochre-clay',
|
||||
white: 'bg-white',
|
||||
cream: 'bg-cream',
|
||||
blue: 'bg-blue text-cream',
|
||||
};
|
||||
|
||||
/**
|
||||
* Brutalist card container with background and padding variants.
|
||||
*/
|
||||
export function Card({ children, className, background = 'ochre', noPadding = false }: CardProps) {
|
||||
export function Card({ children, className, background = 'cream', noPadding = false }: CardProps) {
|
||||
return (
|
||||
<div className={cn('brutal-border brutal-shadow', BG[background], !noPadding && 'p-6 md:p-8', className)}>
|
||||
{children}
|
||||
|
||||
Reference in New Issue
Block a user