import type { Preset } from '@cdx-ui/styles'; import { Box } from '@mui/material'; interface PresetPreviewProps { preset: Preset; isSelected: boolean; } // Converts a pixel value from the 151×85 design space to a cqw-based length // that scales uniformly with the container width. const q = (px: number) => `calc(${String(px)} * 100cqw / 151)`; // Top-left corner only — card body and content panel share the same values. const CORNER_RADIUS: Record = { prestige: '0', poise: `${q(6)} 0 0 0`, pulse: `${q(16)} 0 0 0`, }; // Left border of the content panel uses a blue tint for poise. const PANEL_BORDER_COLOR: Record = { prestige: '#E0E0E0', poise: '#DFE8F1', pulse: '#E0E0E0', }; const SIDEBAR_RX: Record = { prestige: '0', poise: q(3), pulse: q(6), }; const TITLE_RX: Record = { prestige: '0', poise: q(2.5), pulse: q(4), }; const ROW_RX: Record = { prestige: '0', poise: q(2.5), pulse: q(6), }; // Box-shadow equivalents of the SVG filter0 (elevation 2) and filter1 (elevation 1), // expressed in cqw so shadows scale with the container. const ELEVATION_2 = [ `0 ${q(3)} ${q(1)} ${q(-2)} rgba(0,0,0,0.2)`, `0 ${q(2)} ${q(2)} 0 rgba(0,0,0,0.14)`, `0 ${q(1)} ${q(5)} 0 rgba(0,0,0,0.12)`, ].join(', '); const ELEVATION_1 = [ `0 ${q(2)} ${q(1)} ${q(-1)} rgba(0,0,0,0.2)`, `0 ${q(1)} ${q(1)} 0 rgba(0,0,0,0.14)`, `0 ${q(1)} ${q(3)} 0 rgba(0,0,0,0.12)`, ].join(', '); export function PresetPreview({ preset, isSelected: s }: PresetPreviewProps) { const pbc = PANEL_BORDER_COLOR[preset]; const rx = CORNER_RADIUS[preset]; return ( {/* * Card body: inset q(5) from the container's left/top so the elevation shadow * is visible in that margin strip. Bleeds right to the container edge and * q(8) below (clipped by overflow:hidden). */} {/* Sidebar icon placeholders — three 18×18 blocks */} {/* * Content panel: starts at (45, 15) in design space, bleeds right and below. * borderTop + borderLeft replicate the SVG inner-stroke mask; borderRadius * curves the top-left corner of those borders naturally. */} {/* Content title placeholder */} {/* Content row placeholders */} ); }