diff --git a/sundynix-desktop/frontend/src/ui/Button.tsx b/sundynix-desktop/frontend/src/ui/Button.tsx index 7123a13..09ce849 100644 --- a/sundynix-desktop/frontend/src/ui/Button.tsx +++ b/sundynix-desktop/frontend/src/ui/Button.tsx @@ -9,8 +9,8 @@ const base = "inline-flex items-center justify-center gap-1.5 rounded-md font-medium transition select-none disabled:cursor-not-allowed disabled:opacity-40 focus:outline-none focus-visible:ring-2 focus-visible:ring-brand/50"; const variants: Record = { - primary: "bg-brand text-white hover:bg-brand-500 active:bg-brand-600 shadow-glow", - secondary: "border border-line bg-ink-800 text-slate-200 hover:bg-ink-700 hover:border-ink-600", + primary: "bg-brand text-white hover:bg-brand-500 active:scale-[0.98]", + secondary: "border border-line bg-ink-850 text-slate-200 hover:bg-ink-800 hover:border-ink-600", ghost: "text-slate-400 hover:bg-ink-800 hover:text-slate-200", danger: "border border-danger/50 text-danger hover:bg-danger/10", }; diff --git a/sundynix-desktop/frontend/src/ui/Input.tsx b/sundynix-desktop/frontend/src/ui/Input.tsx index e5c3820..941fe07 100644 --- a/sundynix-desktop/frontend/src/ui/Input.tsx +++ b/sundynix-desktop/frontend/src/ui/Input.tsx @@ -4,7 +4,7 @@ import { cn } from "./cn"; // 注意:基类不含宽度。宽度由调用方决定(Field 内为 flex-col 自动撑满, // 或显式 w-full / flex-1 / w-16),避免 w-full 与 flex-1/w-16 冲突塌陷。 const fieldBase = - "rounded-md border border-line bg-ink-950 text-sm text-slate-200 placeholder:text-slate-600 transition focus:border-brand focus:outline-none focus:ring-1 focus:ring-brand/40 disabled:opacity-50"; + "rounded-md border border-line bg-ink-900 text-sm text-slate-200 placeholder:text-slate-600 transition focus:border-brand focus:outline-none focus:ring-2 focus:ring-brand/25 disabled:opacity-50"; export function Input({ className, ...rest }: InputHTMLAttributes) { return ; diff --git a/sundynix-desktop/frontend/src/ui/Table.tsx b/sundynix-desktop/frontend/src/ui/Table.tsx new file mode 100644 index 0000000..172f4c2 --- /dev/null +++ b/sundynix-desktop/frontend/src/ui/Table.tsx @@ -0,0 +1,34 @@ +import type { ReactNode } from "react"; +import { cn } from "./cn"; + +// 轻量数据表格:细分隔线、左对齐表头(弱化)、行 hover。运维/数据场景的标准呈现。 +// 用法:...
...
+ +export function Table({ cols, children, className }: { cols: ReactNode[]; children: ReactNode; className?: string }) { + return ( + + + + {cols.map((c, i) => ( + + ))} + + + {children} +
+ {c} +
+ ); +} + +export function Tr({ children, onClick, className }: { children: ReactNode; onClick?: () => void; className?: string }) { + return ( + + {children} + + ); +} + +export function Td({ children, className }: { children: ReactNode; className?: string }) { + return {children}; +} diff --git a/sundynix-desktop/frontend/src/ui/index.ts b/sundynix-desktop/frontend/src/ui/index.ts index 674a972..1e41eb4 100644 --- a/sundynix-desktop/frontend/src/ui/index.ts +++ b/sundynix-desktop/frontend/src/ui/index.ts @@ -4,6 +4,7 @@ export { Button } from "./Button"; export { Input, Textarea, Select, Field } from "./Input"; export { Card, Panel } from "./Card"; export { Badge, Dot } from "./Badge"; +export { Table, Tr, Td } from "./Table"; export { Tabs, type TabDef } from "./Tabs"; export { Skeleton, EmptyState } from "./Feedback"; export { Dialog, ConfirmFooter } from "./Dialog";