/* global React */
const { useState } = React;
// Letterpress D — official Didion mark (double-frame, tilted, Fraunces D)
function LetterpressD({ size = 32, color = 'var(--accent)', bg = null, tilt = -4 }) {
const p = size * 0.14;
const outer = size - p * 2;
const s = size / 48;
const inner = 3, gap = 2, thin = 1;
return (
);
}
function BrandMark({ size = 28, light = false }) {
const markSize = Math.round(size * 1.1);
return (
Didion
);
}
function Stamp({ children, color = 'var(--text-muted)', filled = false, bold = false }) {
return (
{children}
);
}
function Btn({ children, variant = 'secondary', size = 'md', leadingIcon, trailingIcon, kbd, fullWidth = false, style = {}, ...rest }) {
const SIZES = {
sm: { fontSize: 12, padding: '4px 8px' },
md: { fontSize: 14, padding: '8px 16px' },
lg: { fontSize: 15, padding: '12px 20px' },
};
const VARIANTS = {
primary: { background: 'var(--accent)', color: 'var(--text-on-accent)', borderColor: 'var(--accent)' },
secondary: { background: 'var(--bg-elev)', color: 'var(--text)', borderColor: 'var(--text)' },
ghost: { background: 'transparent', color: 'var(--text)', borderColor: 'transparent' },
solid: { background: 'var(--bg-dark)', color: 'var(--text-on-dark)', borderColor: 'var(--bg-dark)' },
outlineLight: { background: 'transparent', color: 'var(--text-on-dark)', borderColor: 'var(--text-on-dark)' },
};
const v = VARIANTS[variant], s = SIZES[size];
return (
);
}
function Field({ label, type = 'text', placeholder, value, onChange, autoFocus, dark = false, hint }) {
return (
{hint && (
{hint}
)}
);
}
function GoogleGlyph({ size = 16 }) {
return (
);
}
function GoogleBtn({ dark = false }) {
return (
);
}
function Sparkline({ data, color = 'var(--text)', width = 80, height = 18 }) {
const max = Math.max(...data), min = Math.min(...data);
const range = max - min || 1;
const step = width / (data.length - 1);
const pts = data.map((v, i) => `${(i * step).toFixed(1)},${(height - ((v - min) / range) * height).toFixed(1)}`).join(' ');
return (
);
}
function Divider({ label, dark = false }) {
const c = dark ? '#3a342c' : 'var(--border-soft)';
const txt = dark ? 'var(--text-subtle)' : 'var(--text-subtle)';
return (
{label}
);
}
function PlatformGlyph({ kind, size = 12 }) {
const colors = { ig: 'var(--platform-ig)', x: 'var(--platform-x)', news: 'var(--platform-news)' };
return (
);
}
Object.assign(window, { BrandMark, LetterpressD, Stamp, Btn, Field, GoogleBtn, GoogleGlyph, Sparkline, Divider, PlatformGlyph });