File size: 3,211 Bytes
e7abd9e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
import { alpha } from "@mui/material";
export const commonStyles = {
// Tooltips
tooltip: {
sx: {
bgcolor: "background.tooltip",
"& .MuiTooltip-arrow": {
color: "background.tooltip",
},
padding: "12px 16px",
maxWidth: 300,
fontSize: "0.875rem",
lineHeight: 1.4,
},
},
// Progress bars
progressBar: {
position: "absolute",
left: -16,
top: -8,
height: "calc(100% + 16px)",
opacity: (theme) => (theme.palette.mode === "light" ? 0.1 : 0.2),
transition: "width 0.3s ease",
zIndex: 0,
},
// Cell containers
cellContainer: {
display: "flex",
alignItems: "center",
height: "100%",
width: "100%",
position: "relative",
},
// Hover effects
hoverEffect: (theme, isActive = false) => ({
backgroundColor: isActive
? alpha(
theme.palette.primary.main,
theme.palette.mode === "light" ? 0.08 : 0.16
)
: theme.palette.action.hover,
"& .MuiTypography-root": {
color: isActive ? "primary.main" : "text.primary",
},
"& .MuiSvgIcon-root": {
color: isActive ? "primary.main" : "text.primary",
},
}),
// Filter groups
filterGroup: {
title: {
mb: 1,
fontSize: "0.8rem",
fontWeight: 700,
color: "text.primary",
display: "flex",
alignItems: "center",
gap: 0.5,
},
container: {
display: "flex",
flexWrap: "wrap",
gap: 0.5,
alignItems: "center",
},
},
// Option buttons (like in DisplayOptions)
optionButton: {
display: "flex",
alignItems: "center",
gap: 0.8,
cursor: "pointer",
padding: "4px 10px",
borderRadius: 1,
height: "32px",
"& .MuiSvgIcon-root": {
fontSize: "0.9rem",
},
"& .MuiTypography-root": {
fontSize: "0.85rem",
},
},
// Score indicators
scoreIndicator: {
dot: {
width: 10,
height: 10,
borderRadius: "50%",
marginLeft: -1,
},
bar: {
position: "absolute",
left: -16,
top: -8,
height: "calc(100% + 16px)",
opacity: (theme) => (theme.palette.mode === "light" ? 0.1 : 0.2),
transition: "width 0.3s ease",
},
},
// Popover content
popoverContent: {
p: 3,
width: 280,
maxHeight: 400,
overflowY: "auto",
},
};
// Composant styles
export const componentStyles = {
// Table header cell
headerCell: {
borderRight: (theme) =>
`1px solid ${alpha(
theme.palette.divider,
theme.palette.mode === "dark" ? 0.05 : 0.1
)}`,
"&:last-child": {
borderRight: "none",
},
whiteSpace: "nowrap",
overflow: "hidden",
textOverflow: "ellipsis",
padding: "8px 16px",
backgroundColor: (theme) => theme.palette.background.paper,
position: "sticky !important",
top: 0,
zIndex: 10,
},
// Table cell
tableCell: {
borderRight: (theme) =>
`1px solid ${alpha(
theme.palette.divider,
theme.palette.mode === "dark" ? 0.05 : 0.1
)}`,
"&:last-child": {
borderRight: "none",
},
whiteSpace: "nowrap",
overflow: "hidden",
textOverflow: "ellipsis",
},
};
|