Files
MailUI4Agents/client/electron/src/components/icons.tsx

414 lines
9.9 KiB
TypeScript

// 纯 SVG 图标,全站不使用 emoji
type P = { className?: string };
const D = 'w-5 h-5';
function Svg({ className = D, children }: P & { children: React.ReactNode }) {
return (
<svg
className={className}
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="1.8"
strokeLinecap="round"
strokeLinejoin="round"
>
{children}
</svg>
);
}
export function InboxIcon(p: P) {
return (
<Svg {...p}>
<path d="M22 12h-6l-2 3h-4l-2-3H2" />
<path d="M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z" />
</Svg>
);
}
export function SentIcon(p: P) {
return (
<Svg {...p}>
<path d="m22 2-7 20-4-9-9-4Z" />
<path d="M22 2 11 13" />
</Svg>
);
}
export function ContactsIcon(p: P) {
return (
<Svg {...p}>
<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" />
<circle cx="9" cy="7" r="4" />
<path d="M22 21v-2a4 4 0 0 0-3-3.87" />
<path d="M16 3.13a4 4 0 0 1 0 7.75" />
</Svg>
);
}
export function ComposeIcon(p: P) {
return (
<Svg {...p}>
<path d="M12 20h9" />
<path d="M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z" />
</Svg>
);
}
export function MailIcon(p: P) {
return (
<Svg {...p}>
<rect width="20" height="16" x="2" y="4" rx="2" />
<path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7" />
</Svg>
);
}
export function ShieldIcon(p: P) {
return (
<Svg {...p}>
<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" />
</Svg>
);
}
export function PersonIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" />
<circle cx="12" cy="7" r="4" />
</Svg>
);
}
export function BotIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<rect width="18" height="10" x="3" y="11" rx="2" />
<circle cx="12" cy="5" r="2" />
<path d="M12 7v4" />
<path d="M8 16h.01" />
<path d="M16 16h.01" />
</Svg>
);
}
export function CheckIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<path d="M20 6 9 17l-5-5" />
</Svg>
);
}
export function CloseIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<path d="M18 6 6 18" />
<path d="m6 6 12 12" />
</Svg>
);
}
export function TrashIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<path d="M3 6h18" />
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" />
<path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />
</Svg>
);
}
export function ArchiveIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<rect width="20" height="5" x="2" y="3" rx="1" />
<path d="M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8" />
<path d="M10 12h4" />
</Svg>
);
}
export function ChevronRightIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<path d="m9 18 6-6-6-6" />
</Svg>
);
}
export function LogoutIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" />
<path d="m16 17 5-5-5-5" />
<path d="M21 12H9" />
</Svg>
);
}
export function UsersIcon({ className = D }: P) {
return (
<Svg className={className}>
<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" />
<circle cx="9" cy="7" r="4" />
<path d="M22 21v-2a4 4 0 0 0-3-3.87" />
<path d="M16 3.13a4 4 0 0 1 0 7.75" />
</Svg>
);
}
export function LockIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<rect width="18" height="11" x="3" y="11" rx="2" />
<path d="M7 11V7a5 5 0 0 1 10 0v4" />
</Svg>
);
}
export function MailboxIcon({ className = 'w-8 h-8' }: P) {
return (
<Svg className={className}>
<path d="M22 17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9.5C2 7 4 5 6.5 5H18c2.2 0 4 1.8 4 4z" />
<path d="M6 8h4" />
<path d="M12 19V5" />
</Svg>
);
}
export function SpinnerIcon({ className = 'w-4 h-4' }: P) {
return (
<svg className={`${className} animate-spin`} viewBox="0 0 24 24" fill="none">
<circle cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="3" opacity="0.25" />
<path
d="M12 2a10 10 0 0 1 10 10"
stroke="currentColor"
strokeWidth="3"
strokeLinecap="round"
/>
</svg>
);
}
export function KeyIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<circle cx="7.5" cy="15.5" r="4.5" />
<path d="M10.7 12.3 21 2" />
<path d="m17 6 3 3" />
<path d="m14 9 3 3" />
</Svg>
);
}
export function CopyIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<rect width="12" height="12" x="9" y="9" rx="2" />
<path d="M5 15V5a2 2 0 0 1 2-2h10" />
</Svg>
);
}
export function PlusIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<path d="M12 5v14M5 12h14" />
</Svg>
);
}
export function ForwardIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<path d="m15 17 5-5-5-5" />
<path d="M4 18v-2a4 4 0 0 1 4-4h12" />
</Svg>
);
}
export function PaperclipIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<path d="M13.2 2.8a5 5 0 0 1 7 7l-8.5 8.5a3.2 3.2 0 0 1-4.5-4.5l8-8a1.4 1.4 0 0 1 2 2l-7.5 7.5" />
</Svg>
);
}
export function DownloadIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<path d="M12 3v12" />
<path d="m7 11 5 5 5-5" />
<path d="M4 20h16" />
</Svg>
);
}
export function FileIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z" />
<path d="M14 3v5h5" />
</Svg>
);
}
export function TreeIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<rect x="9" y="3" width="6" height="4" rx="1" />
<rect x="3" y="17" width="6" height="4" rx="1" />
<rect x="15" y="17" width="6" height="4" rx="1" />
<path d="M12 7v4M6 17v-3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v3" />
</Svg>
);
}
export function TagIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<path d="M20.6 13.4 13.4 20.6a2 2 0 0 1-2.8 0l-7.2-7.2A2 2 0 0 1 3 12V4a1 1 0 0 1 1-1h8a2 2 0 0 1 1.4.6l7.2 7.2a2 2 0 0 1 0 2.8Z" />
<circle cx="7.5" cy="7.5" r="1" />
</Svg>
);
}
export function GaugeIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<path d="M12 14 15.5 9" />
<path d="M3.5 17a9 9 0 1 1 17 0" />
<circle cx="12" cy="14" r="1.2" />
</Svg>
);
}
export function ChevronLeftIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<path d="m15 18-6-6 6-6" />
</Svg>
);
}
export function MenuIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<path d="M4 7h16M4 12h16M4 17h16" />
</Svg>
);
}
export function ListViewIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<path d="M8 6h12M8 12h12M8 18h12M4 6h.01M4 12h.01M4 18h.01" />
</Svg>
);
}
export function CardViewIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<rect x="3" y="4" width="18" height="7" rx="1.5" />
<rect x="3" y="14" width="18" height="6" rx="1.5" />
</Svg>
);
}
export function CpuIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<rect x="4" y="4" width="16" height="16" rx="2" />
<rect x="9" y="9" width="6" height="6" />
<path d="M9 2v2M15 2v2M9 20v2M15 20v2M2 9h2M2 15h2M20 9h2M20 15h2" />
</Svg>
);
}
export function CalendarIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<rect x="3" y="5" width="18" height="16" rx="2" />
<path d="M3 10h18M8 3v4M16 3v4" />
</Svg>
);
}
export function BellIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<path d="M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9" />
<path d="M13.7 21a2 2 0 0 1-3.4 0" />
</Svg>
);
}
export function RepeatIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<path d="M17 2l4 4-4 4" />
<path d="M3 11v-1a4 4 0 0 1 4-4h14" />
<path d="M7 22l-4-4 4-4" />
<path d="M21 13v1a4 4 0 0 1-4 4H3" />
</Svg>
);
}
export function UploadIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
<path d="M17 8l-5-5-5 5M12 3v12" />
</Svg>
);
}
export function PauseIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<rect x="6" y="4" width="4" height="16" />
<rect x="14" y="4" width="4" height="16" />
</Svg>
);
}
export function PlayIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<path d="M5 3l14 9-14 9V3z" />
</Svg>
);
}
export function SunIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<circle cx="12" cy="12" r="4" />
<path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4" />
</Svg>
);
}
export function MoonIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<path d="M21 12.8A8.5 8.5 0 1 1 11.2 3a6.6 6.6 0 0 0 9.8 9.8z" />
</Svg>
);
}
export function MonitorIcon({ className = 'w-4 h-4' }: P) {
return (
<Svg className={className}>
<rect x="2" y="4" width="20" height="13" rx="2" />
<path d="M8 21h8M12 17v4" />
</Svg>
);
}