d3ro-voice/apps/admin/src/lib/console-theme.ts

190 lines
5.1 KiB
TypeScript

// apps/admin/src/lib/console-theme.ts
// D3RO Voice Admin CRM — "Midnight Glass v2" Design Tokens & UI Helpers
// Fully aligned with @d3ro/ui/theme SSOT & High-End Awwwards/Linear aesthetic
import { d3roFontSans, d3roFontMono } from '@d3ro/ui/theme'
export const C = {
// backgrounds
base: '#070b16',
app: '#0a0e1c',
card: '#111a30',
cardHover: '#152039',
elevated: '#1a2540',
input: '#0d1526',
sidebar: '#0b101f',
inset: '#0a111f',
chassis: '#111a30',
// borders
border: 'rgba(148, 180, 255, 0.08)',
borderHl: 'rgba(148, 180, 255, 0.16)',
borderStrong: 'rgba(148, 180, 255, 0.24)',
// text
dim: '#7e8eb0',
text: '#93a4c8',
bright: '#eef2fb',
muted: '#5c6b8a',
// accents & gradients
accent: '#3b82f6',
accentLight: '#60a5fa',
accentDark: '#1d4ed8',
cyan: '#06b6d4',
cyanLight: '#22d3ee',
purple: '#8b5cf6',
purple400: '#a78bfa',
green: '#10b981',
green400: '#34d399',
orange: '#f59e0b',
orange400: '#fbbf24',
red: '#ef4444',
red400: '#f87171',
} as const
export const FONT_SANS = d3roFontSans
export const FONT_MONO = d3roFontMono
/** Flat Precision Panel Style (v4) */
export const panelSx = {
position: 'relative' as const,
bgcolor: C.card,
border: `1px solid ${C.borderHl}`,
borderRadius: '12px',
overflow: 'hidden',
boxShadow: 'none',
transition: 'border-color 160ms cubic-bezier(0.22, 1, 0.36, 1)',
'&:hover': {
borderColor: C.borderStrong,
},
}
/** Inner Core Style (v4) */
export const innerCoreSx = {
position: 'relative' as const,
borderRadius: '10px',
bgcolor: C.inset,
border: `1px solid ${C.border}`,
p: 2.5,
boxShadow: 'none',
}
/** Interactive Table Style */
export const tableSx = {
width: '100%',
borderCollapse: 'separate' as const,
borderSpacing: '0 6px',
fontFamily: FONT_SANS,
fontSize: '13px',
'& th': {
px: 2,
pb: 1.5,
fontWeight: 500,
fontSize: '11px',
letterSpacing: 0,
color: C.dim,
textAlign: 'left' as const,
borderBottom: `1px solid ${C.borderHl}`,
},
'& td': {
px: 2,
py: 1.75,
textAlign: 'left' as const,
color: C.text,
bgcolor: C.card,
borderTop: `1px solid ${C.border}`,
borderBottom: `1px solid ${C.border}`,
transition: 'background-color 160ms cubic-bezier(0.22, 1, 0.36, 1), border-color 160ms cubic-bezier(0.22, 1, 0.36, 1), color 160ms cubic-bezier(0.22, 1, 0.36, 1)',
'&:first-of-type': {
borderLeft: `1px solid ${C.border}`,
borderTopLeftRadius: '8px',
borderBottomLeftRadius: '8px',
},
'&:last-of-type': {
borderRight: `1px solid ${C.border}`,
borderTopRightRadius: '8px',
borderBottomRightRadius: '8px',
},
},
'& tr:hover td': {
bgcolor: C.cardHover,
borderColor: C.borderHl,
color: C.bright,
},
}
/** Filter Pill Button Style */
export const filterBtnSx = (active: boolean) => ({
px: 2,
py: 0.75,
borderRadius: '999px',
fontFamily: FONT_SANS,
fontSize: '11px',
fontWeight: 500,
letterSpacing: 0,
textTransform: 'none' as const,
cursor: 'pointer',
border: `1px solid ${active ? 'rgba(59, 130, 246, 0.4)' : C.borderHl}`,
bgcolor: active ? 'rgba(59, 130, 246, 0.16)' : C.card,
color: active ? C.bright : C.dim,
boxShadow: 'none',
'&:hover': {
bgcolor: active ? 'rgba(59, 130, 246, 0.22)' : C.cardHover,
borderColor: active ? C.accentLight : C.borderStrong,
color: C.bright,
},
transition: 'background-color 160ms cubic-bezier(0.22, 1, 0.36, 1), border-color 160ms cubic-bezier(0.22, 1, 0.36, 1), color 160ms cubic-bezier(0.22, 1, 0.36, 1)',
})
/** Semantic Status Badge Style */
export function statusBadgeSx(variant: 'green' | 'red' | 'orange' | 'blue' | 'purple' | 'cyan') {
const colorMap = {
green: { bg: 'rgba(16, 185, 129, 0.12)', fg: C.green400, border: 'rgba(16, 185, 129, 0.3)' },
red: { bg: 'rgba(239, 68, 68, 0.12)', fg: C.red400, border: 'rgba(239, 68, 68, 0.3)' },
orange: { bg: 'rgba(245, 158, 11, 0.12)', fg: C.orange400, border: 'rgba(245, 158, 11, 0.3)' },
blue: { bg: 'rgba(59, 130, 246, 0.12)', fg: C.accentLight, border: 'rgba(59, 130, 246, 0.3)' },
purple: { bg: 'rgba(139, 92, 246, 0.12)', fg: C.purple400, border: 'rgba(139, 92, 246, 0.3)' },
cyan: { bg: 'rgba(6, 182, 212, 0.12)', fg: C.cyanLight, border: 'rgba(6, 182, 212, 0.3)' },
}
const c = colorMap[variant]
return {
display: 'inline-flex',
alignItems: 'center',
gap: 0.75,
px: 1.25,
py: 0.4,
borderRadius: '999px',
fontSize: '11px',
fontFamily: FONT_SANS,
fontWeight: 500,
letterSpacing: 0,
bgcolor: c.bg,
color: c.fg,
border: `1px solid ${c.border}`,
boxShadow: 'none',
}
}
/** Primary Action Button Style */
export const primaryButtonSx = {
bgcolor: C.accentDark,
color: '#ffffff',
fontFamily: FONT_SANS,
fontSize: '13px',
fontWeight: 500,
borderRadius: '8px',
px: 2.5,
py: 1,
boxShadow: 'none',
textTransform: 'none' as const,
transition: 'background-color 160ms cubic-bezier(0.22, 1, 0.36, 1)',
'&:hover': {
bgcolor: C.accent,
boxShadow: 'none',
},
}
// Backward compatibility alias for FONT
export const FONT = FONT_MONO