/
sweetebin
/
hackaton_26
Обзор
Документация
Войти
/
sweetebin
/
hackaton_26
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
web-form-project/src/theme.js
71 строка
2 KB
sweetebin
качество обработки под GigaCode/Qwen35B + N/A-тип + UX-тултипы; архив первого прогона
28 июл 2026, 14:44
28 июл 2026, 14:44
f397b39
Код
Авторство
О чём код?
import { createTheme } from '@mui/material/styles'; // Категориальная палитра для кластеров — фиксированный порядок, без циклов; // кластеры сверх восьми получают нейтральный серый. export const CLUSTER_COLORS = [ '#2a78d6', '#1baf7a', '#eda100', '#008300', '#4a3aa7', '#e34948', '#e87ba4', '#eb6834', ]; const OVERFLOW_COLOR = '#898781'; export function clusterColor(clusters, clusterId) { const i = clusters.findIndex((c) => c.id === clusterId); return i >= 0 && i < CLUSTER_COLORS.length ? CLUSTER_COLORS[i] : OVERFLOW_COLOR; } export const SENTIMENT = { positive: { label: 'Позитив', chip: 'success' }, neutral: { label: 'Нейтрально', chip: 'default' }, negative: { label: 'Негатив', chip: 'error' }, }; export const SEVERITY = { critical: { label: 'Критичная', hex: '#d03b3b' }, high: { label: 'Высокая', hex: '#ec835a' }, medium: { label: 'Средняя', hex: '#fab219' }, low: { label: 'Низкая', hex: '#0ca30c' }, }; export const PRIORITY_CHIP = { Highest: 'error', High: 'warning', Medium: 'info', Low: 'default', }; export const theme = createTheme({ palette: { primary: { main: '#2a78d6' }, background: { default: '#f7f8fa', paper: '#ffffff' }, }, typography: { fontFamily: '"Roboto", system-ui, -apple-system, "Segoe UI", sans-serif', h6: { fontWeight: 600 }, }, shape: { borderRadius: 10 }, components: { // Тултипы — основной канал подсказок в UI: со стрелкой и читаемым кеглем MuiTooltip: { defaultProps: { arrow: true, enterDelay: 250 }, styleOverrides: { tooltip: { fontSize: 12.5, lineHeight: 1.45, maxWidth: 340, padding: '8px 12px' }, }, }, MuiTableHead: { styleOverrides: { root: { '& th': { fontWeight: 600, backgroundColor: '#fbfbfc', whiteSpace: 'nowrap' }, }, }, }, MuiChip: { styleOverrides: { root: { fontWeight: 500 } }, }, }, });