// Sanad Design System — Shared Primitives // Export to window for cross-file use const sanadColors = { // ليكسا بالأسود (2026-10-26): حبرٌ نجديّ للأسطح، رمليٌّ للنصّ، طينيٌّ للفعل brand: '#c96442', brandLight: '#e07a52', brandDark: '#e8845f', brandSubtle: 'rgba(224,122,82,0.16)', bg: '#0f1715', bgElevated: '#16211d', bgSubtle: '#1d2a25', bgDark: '#070b0a', textPrimary: '#efe7d6', textSecondary: '#c9c2b3', textTertiary: '#a8a69e', textMuted: '#8f9a94', textInverted: '#efe7d6', border: 'rgba(239,231,214,0.12)', borderLight: 'rgba(239,231,214,0.08)', error: '#ff8a8a', focus: '#e07a52', success: '#5fbf8a', }; const sanadFonts = { arabic: "'IBM Plex Sans Arabic', 'Noto Sans Arabic', sans-serif", serif: "Georgia, serif", mono: "'JetBrains Mono', monospace", }; // ── Button ───────────────────────────────────────────────── function SanadButton({ variant = 'primary', size = 'md', children, onClick, icon, disabled, style = {} }) { const [hovered, setHovered] = React.useState(false); const base = { display: 'inline-flex', alignItems: 'center', gap: 7, fontFamily: sanadFonts.arabic, fontWeight: 500, border: 'none', cursor: disabled ? 'not-allowed' : 'pointer', transition: 'all 180ms ease', borderRadius: 10, opacity: disabled ? 0.45 : 1, textDecoration: 'none', }; const sizes = { sm: { padding: '6px 12px', fontSize: 13, borderRadius: 8 }, md: { padding: '10px 18px', fontSize: 15 }, lg: { padding: '13px 26px', fontSize: 17, borderRadius: 12 }, }; const variants = { primary: { background: hovered ? sanadColors.brandDark : sanadColors.brand, color: sanadColors.textInverted, boxShadow: '0 0 0 1px rgba(239,231,214,0.10)', }, secondary: { background: hovered ? sanadColors.bgSubtle : sanadColors.bgElevated, color: sanadColors.textPrimary, boxShadow: '0 0 0 1px rgba(239,231,214,0.14)', }, ghost: { background: hovered ? 'rgba(0,0,0,0.06)' : 'transparent', color: sanadColors.textSecondary, boxShadow: 'none', }, }; return ( ); } // ── Badge ────────────────────────────────────────────────── function SanadBadge({ children, color = 'brand' }) { const colors = { brand: { bg: sanadColors.brandSubtle, text: sanadColors.brand }, neutral: { bg: sanadColors.bgSubtle, text: sanadColors.textSecondary }, success: { bg: 'rgba(95,191,138,0.16)', text: sanadColors.success }, error: { bg: '#f7e5e5', text: sanadColors.error }, warning: { bg: '#fef3e2', text: '#a05e1a' }, info: { bg: '#deeefb', text: sanadColors.focus }, dark: { bg: sanadColors.bgDark, text: sanadColors.textInverted }, }; const c = colors[color] || colors.brand; return ( {children} ); } // ── Input ────────────────────────────────────────────────── function SanadInput({ placeholder, value, onChange, type = 'text', icon, multiline, rows = 3, style = {} }) { const [focused, setFocused] = React.useState(false); const baseStyle = { width: '100%', padding: icon ? '10px 38px 10px 14px' : '10px 14px', borderRadius: 8, border: 'none', background: sanadColors.bgElevated, boxShadow: focused ? `0 0 0 1px rgba(239,231,214,0.14), 0 0 0 3px rgba(56,152,236,0.25)` : '0 0 0 1px rgba(239,231,214,0.14)', fontFamily: sanadFonts.arabic, fontSize: 15, color: sanadColors.textPrimary, outline: 'none', direction: 'rtl', resize: multiline ? 'vertical' : 'none', transition: 'box-shadow 150ms ease', ...style, }; const wrap = { position: 'relative', width: '100%' }; const iconStyle = { position: 'absolute', top: '50%', transform: 'translateY(-50%)', right: 12, color: sanadColors.textMuted, pointerEvents: 'none' }; if (multiline) return (