refactor(css): delete dead pre-MUI CSS and eliminate plan.css

Phase 1 of the "fully MUI" CSS cleanup.

- base.css 429->317: drop dead .admin-sidebar/header/card/modal,
  .admin-drag-handle/-kbd/-mono/-error-stack/-loading and the unused
  float/pulse keyframes. Keep reset, typography, scrollbar,
  ::view-transition cross-fade, the live .admin-spinner (App.tsx
  pre-React loader) and all utility classes.
- attendance.css 456->24: keep only the Leaflet .attendance-location-map
  rules; the old hand-rolled Attendance page is MUI now.
- offers.css 642->417: keep only the Quill (.admin-rich-editor/.ql-*)
  and .admin-rich-text-view rules; drop the dead offers table / filter /
  lang-badge / row-state rules.
- plan.css deleted: the grid already lives in PlanGrid's styled()
  wrapper; the last consumer (.plan-cat-color) is now an sx-styled
  Box input in PlanCategoriesModal.

tsc -b --noEmit and npm run build both clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
BOHA
2026-06-07 17:20:17 +02:00
parent fa90bcc93b
commit 96e35df535
6 changed files with 25 additions and 834 deletions

View File

@@ -1,4 +1,4 @@
import { useState } from "react";
import { useState, type ChangeEvent, type FocusEvent } from "react";
import Box from "@mui/material/Box";
import { Modal, TextField, Button } from "../ui";
import { useApiMutation } from "../lib/queries/mutations";
@@ -100,6 +100,19 @@ export default function PlanCategoriesModal({
py: 1,
} as const;
// Native color picker, styled to match the row (was the .plan-cat-color rule).
const colorInputSx = {
width: 34,
height: 34,
p: 0,
border: 1,
borderColor: "divider",
borderRadius: "6px",
background: "none",
cursor: "pointer",
flex: "0 0 auto",
} as const;
return (
<Modal
isOpen={isOpen}
@@ -113,9 +126,10 @@ export default function PlanCategoriesModal({
<Box>
{categories.map((c) => (
<Box key={c.id} sx={{ ...rowSx, opacity: c.is_active ? 1 : 0.55 }}>
<input
<Box
component="input"
type="color"
className="plan-cat-color"
sx={colorInputSx}
// Uncontrolled + patch on blur (like the rename input): the
// native color picker fires onChange on every drag tick, which
// would spam PATCH requests and the audit log. onBlur commits
@@ -123,7 +137,7 @@ export default function PlanCategoriesModal({
defaultValue={c.color}
key={c.color}
disabled={busy}
onBlur={(e) => {
onBlur={(e: FocusEvent<HTMLInputElement>) => {
if (e.target.value !== c.color) {
patch(c.id, { color: e.target.value });
}
@@ -190,12 +204,15 @@ export default function PlanCategoriesModal({
<Box
sx={{ ...rowSx, mt: 1, pt: 2, borderTop: 1, borderColor: "divider" }}
>
<input
<Box
component="input"
type="color"
className="plan-cat-color"
sx={colorInputSx}
value={newColor}
disabled={busy}
onChange={(e) => setNewColor(e.target.value)}
onChange={(e: ChangeEvent<HTMLInputElement>) =>
setNewColor(e.target.value)
}
aria-label="Barva nové kategorie"
/>
<TextField