feat(mui): consistent staggered page entrance across all 43 route pages

Adopt the PageEnter wrapper as every page's outermost render element and remove the ad-hoc per-page entrance motion.div wrappers. Every page now enters the same way — all top-level sections rise+fade in, staggered — so nothing appears instantly and the motion is identical app-wide. Presentation-only: no data/logic/hooks/invalidate/permissions touched. Embedded sub-tabs (CompanySettings, ReceivedInvoices), Login (auth shell) and the dev UiKit are intentionally excluded. Gates: tsc -b --noEmit=0, build=0, vitest 152/152.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
BOHA
2026-06-07 10:13:06 +02:00
parent b273614128
commit 39fe84ce99
43 changed files with 4956 additions and 5709 deletions

View File

@@ -1,6 +1,5 @@
import { Link as RouterLink } from "react-router-dom";
import { useQuery } from "@tanstack/react-query";
import { motion } from "framer-motion";
import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
import { useAuth } from "../context/AuthContext";
@@ -22,6 +21,7 @@ import {
EmptyState,
LoadingState,
PageHeader,
PageEnter,
type DataColumn,
type StatCardColor,
} from "../ui";
@@ -193,74 +193,64 @@ export default function Warehouse() {
];
return (
<Box>
<motion.div
initial={{ opacity: 0, y: 12 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.25 }}
>
<PageHeader
title="Sklad"
subtitle="Přehled skladových zásob"
actions={
<Box sx={{ display: "flex", gap: 1.5, flexWrap: "wrap" }}>
{hasPermission("warehouse.operate") && (
<>
<Button
component={RouterLink}
to="/warehouse/receipts/new"
startIcon={ReceiptIcon}
>
Nový příjem
</Button>
<Button
component={RouterLink}
to="/warehouse/issues/new"
variant="outlined"
color="inherit"
startIcon={IssueIcon}
>
Nový výdej
</Button>
</>
)}
{hasPermission("warehouse.manage") && (
<PageEnter>
<PageHeader
title="Sklad"
subtitle="Přehled skladových zásob"
actions={
<Box sx={{ display: "flex", gap: 1.5, flexWrap: "wrap" }}>
{hasPermission("warehouse.operate") && (
<>
<Button
component={RouterLink}
to="/warehouse/categories"
to="/warehouse/receipts/new"
startIcon={ReceiptIcon}
>
Nový příjem
</Button>
<Button
component={RouterLink}
to="/warehouse/issues/new"
variant="outlined"
color="inherit"
startIcon={IssueIcon}
>
Kategorie
Nový výdej
</Button>
)}
</>
)}
{hasPermission("warehouse.manage") && (
<Button
component={RouterLink}
to="/warehouse/items"
to="/warehouse/categories"
variant="outlined"
color="inherit"
>
Položky
Kategorie
</Button>
<Button
component={RouterLink}
to="/warehouse/reports"
variant="outlined"
color="inherit"
>
Reporty
</Button>
</Box>
}
/>
</motion.div>
)}
<Button
component={RouterLink}
to="/warehouse/items"
variant="outlined"
color="inherit"
>
Položky
</Button>
<Button
component={RouterLink}
to="/warehouse/reports"
variant="outlined"
color="inherit"
>
Reporty
</Button>
</Box>
}
/>
{/* KPI cards */}
<Box
component={motion.div}
initial={{ opacity: 0, y: 12 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.25, delay: 0.06 }}
sx={{
display: "grid",
gridTemplateColumns: {
@@ -296,13 +286,7 @@ export default function Warehouse() {
{/* Below minimum alert */}
{belowMin.length > 0 && (
<Box
component={motion.div}
initial={{ opacity: 0, y: 12 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.25, delay: 0.14 }}
sx={{ mb: 3 }}
>
<Box sx={{ mb: 3 }}>
<Card sx={{ borderColor: "error.main", borderWidth: 1 }}>
<Box
sx={{
@@ -342,12 +326,7 @@ export default function Warehouse() {
)}
{/* Recent movements */}
<Box
component={motion.div}
initial={{ opacity: 0, y: 12 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.25, delay: 0.16 }}
>
<Box>
<Card>
<Box
sx={{
@@ -381,6 +360,6 @@ export default function Warehouse() {
)}
</Card>
</Box>
</Box>
</PageEnter>
);
}