feat(portal-shell): v2.0 P0 shadcn standardization + security + streaming + error handling

- shadcn/ui 标准化:废弃纸感令牌,统一 bg-background/text-foreground 等
- Tailwind v4 + @theme inline,移除 tailwind.config.js
- React 19 use() + Suspense 流式渲染,首屏骨架秒出
- 三级错误边界:Route → Section → Widget 层层兜底
- 错误上报:useErrorReport → sendBeacon → /api/log mock 端点
- 三层安全边界:L1 角色门禁 / L2 权限点门禁 / L3 数据范围
- 权限位图 base36 压缩:67 权限点 → ~14 字符,JWT 体积减少 ≥ 99%
- notify 统一 Toast 封装,禁止业务直接 import sonner
- PluginBoundary 替代 PluginLoader(错误边界 + Suspense + Skeleton 三件套)

验证:typecheck 0 错误 / lint 0 错误 / build 6 路由生成成功
This commit is contained in:
SpecialX
2026-07-17 16:10:05 +08:00
parent f7e52b5b7f
commit 9cedf0c437
140 changed files with 10872 additions and 3192 deletions

View File

@@ -123,14 +123,7 @@ export function Calendar({
const today = formatDate(new Date());
return (
<div
className="w-full"
style={{
background: "var(--bg-surface)",
borderRadius: "var(--radius-card)",
padding: "var(--space-md)",
}}
>
<div className="w-full rounded-xl border bg-card p-4">
{/* 月份导航 */}
<div className="flex items-center justify-between mb-4">
<button
@@ -197,14 +190,14 @@ export function Calendar({
type="button"
key={`day-${dateStr}`}
onClick={() => onDateClick?.(cell.date!)}
className="min-h-[60px] p-1 text-left transition-colors hover:bg-[var(--bg-subtle)]"
className="min-h-[60px] p-1 text-left transition-colors hover:bg-muted"
style={{
background: isToday
? "var(--color-accent-subtle)"
? "hsl(var(--primary) / 0.1)"
: "transparent",
borderRadius: "var(--radius-default)",
borderRadius: "var(--radius)",
border: isToday
? "1px solid var(--color-accent)"
? "1px solid hsl(var(--primary))"
: "1px solid transparent",
cursor: "pointer",
}}
@@ -213,8 +206,8 @@ export function Calendar({
className="text-xs mb-1"
style={{
color: isToday
? "var(--color-accent)"
: "var(--color-ink-muted)",
? "hsl(var(--primary))"
: "hsl(var(--muted-foreground))",
fontWeight: isToday ? "600" : "400",
}}
>