mirror of
https://github.com/dream-pep/koring-launcher.git
synced 2026-09-12 05:45:18 +08:00
- 引入 electron-updater 实现自动更新功能 - 新增 Java 环境扫描与校验的 IPC 处理逻辑 - 实现离线账号登录功能 - 新增配置变更跨进程广播机制 - 重构游戏启动逻辑,使用主进程内存配置作为唯一权威来源 - 新增界面显示与语言设置的配置页面 - 添加 Windows 平台自动发布 CI 流水线 - 迁移旧版配置/认证文件到用户数据目录 - 修复崩溃日志路径、表单控件等多项 bug - 重构设置页组件系统统一界面样式
66 lines
1.5 KiB
TypeScript
66 lines
1.5 KiB
TypeScript
import { cn } from "@/lib/utils";
|
|
import { SettingSurface } from "./SettingSurface";
|
|
|
|
interface SurfaceProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
variant?: "raised" | "flat" | "bordered";
|
|
frost?: "none" | "sm" | "md" | "lg";
|
|
padding?: "none" | "sm" | "md" | "lg";
|
|
}
|
|
|
|
const paddingMap = {
|
|
none: "",
|
|
sm: "px-3 py-2.5",
|
|
md: "px-5 py-4",
|
|
lg: "px-6 py-5",
|
|
};
|
|
|
|
// Surface 是 SettingSurface 的兼容别名(保留原 API,样式与设置卡片统一)
|
|
function Surface({
|
|
variant = "raised",
|
|
frost = "none",
|
|
padding = "md",
|
|
className,
|
|
children,
|
|
...props
|
|
}: SurfaceProps) {
|
|
return (
|
|
<SettingSurface
|
|
variant={variant}
|
|
frost={frost !== "none"}
|
|
className={cn(
|
|
paddingMap[padding],
|
|
variant === "flat" && "bg-transparent border-0 backdrop-blur-none",
|
|
className,
|
|
)}
|
|
{...props}
|
|
>
|
|
{children}
|
|
</SettingSurface>
|
|
);
|
|
}
|
|
|
|
function SurfaceHeader({ className, children, ...props }: React.HTMLAttributes<HTMLDivElement>) {
|
|
return (
|
|
<div
|
|
data-slot="surface-header"
|
|
className={cn(
|
|
"flex items-center gap-2 mb-3 pb-3 border-b border-black/[0.06] dark:border-white/[0.06]",
|
|
className,
|
|
)}
|
|
{...props}
|
|
>
|
|
{children}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
function SurfaceContent({ className, children, ...props }: React.HTMLAttributes<HTMLDivElement>) {
|
|
return (
|
|
<div data-slot="surface-content" className={cn("space-y-3", className)} {...props}>
|
|
{children}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export { Surface, SurfaceHeader, SurfaceContent }
|