style: add more components and add test wiki page

This commit is contained in:
robin committed 2026-08-04 15:37:30 +02:00
1 parent fd4da2a43f
commit 3d82ef9671
5 files changed
+113 -14

No files matched your search

+58
View File
@@ -0,0 +1,58 @@
import React from 'react';
// 1. Callout (Info, Warning, Error)
export function Callout({ children, type = 'info' }: { children: React.ReactNode, type?: 'info' | 'warning' | 'error' | 'success' }) {
const variants = {
info: "bg-blue-500/10 border-blue-500 text-blue-200",
warning: "bg-amber-500/10 border-amber-500 text-amber-200",
error: "bg-red-500/10 border-red-500 text-red-200",
success: "bg-emerald-500/10 border-emerald-500 text-emerald-200",
};
return (
<div className={`p-4 my-6 rounded-xl border-l-4 ${variants[type]}`}>
<div className="flex gap-3">
<div className="mt-1">
{type === 'info' && <svg className="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>}
{type === 'warning' && <svg className="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" /></svg>}
</div>
<div className="text-sm leading-relaxed">{children}</div>
</div>
</div>
);
}
// 2. Card Grid (Für Übersichtsseiten)
export function Grid({ children }: { children: React.ReactNode }) {
return <div className="grid grid-cols-1 md:grid-cols-2 gap-4 my-8">{children}</div>;
}
export function Card({ title, href, children }: { title: string, href: string, children: React.ReactNode }) {
return (
<a href={href} className="block p-6 bg-zinc-900 border border-zinc-800 rounded-xl hover:border-blue-500 transition-colors group">
<h3 className="text-lg font-bold text-white group-hover:text-blue-400 m-0 mb-2">{title}</h3>
<p className="text-zinc-400 text-sm m-0 leading-relaxed">{children}</p>
</a>
);
}
// 3. Steps (Für nummerierte Anleitungen)
export function Steps({ children }: { children: React.ReactNode }) {
return (
<div className="steps-container ml-4 border-l border-zinc-800 pl-8 my-8 space-y-8">
{children}
</div>
);
}
export function Step({ title, children }: { title: string, children: React.ReactNode }) {
return (
<div className="relative">
<div className="absolute -left-[41px] flex h-5 w-5 items-center justify-center rounded-full bg-zinc-900 border border-zinc-800 text-[10px] font-bold text-white">
{/* Die Nummerierung macht CSS automatisch, siehe unten */}
</div>
<h3 className="text-white font-bold mb-2 mt-0">{title}</h3>
<div className="text-zinc-400 text-sm">{children}</div>
</div>
);
}