revert(redesign): Design-Tokens + Ebene-2 "Cyber trifft Safety" zurueckziehen
Das Frontend-Redesign wird vorerst pausiert (Fokus MVP). Der komplette
Stand ist im Git-Tag redesign-archive-20260619 (Commit 42d4b4d9)
archiviert und jederzeit fortsetzbar; die Handoff-Docs bleiben unter
design/redesign/ erhalten. Diese Aenderung zieht nur den aktiven Code
zurueck (Tokens, Chips, CyberMeetsSafety, design-system-Seite, Font-Setup) —
die UI kehrt zum vorherigen Stand zurueck.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1,64 +0,0 @@
|
||||
'use client'
|
||||
|
||||
// Reusable design-language chips. Geltung (Pflicht/Empfehlung/Kann) and Severity
|
||||
// follow the handoff specs exactly (bg/text/border + marker glyph). Klartext label
|
||||
// leads; internal IDs are never shown by the chip itself. See ./tokens.
|
||||
|
||||
import {
|
||||
GELTUNG, PFLICHT_MARKER, SEVERITY, DOMAIN,
|
||||
normalizeGeltung, normalizeSeverity, Geltung, Severity, Domain,
|
||||
} from './tokens'
|
||||
|
||||
function GeltungMarker({ g }: { g: Geltung }) {
|
||||
const m = GELTUNG[g].marker
|
||||
if (m === 'square') {
|
||||
return <span aria-hidden style={{ width: 7, height: 7, borderRadius: 2, background: PFLICHT_MARKER, display: 'inline-block' }} />
|
||||
}
|
||||
// diamond ◇ (Empfehlung) / circle ○ (Kann) — open glyphs in the chip text color
|
||||
return <span aria-hidden style={{ fontSize: 10, lineHeight: 1 }}>{m === 'diamond' ? '◇' : '○'}</span>
|
||||
}
|
||||
|
||||
export function GeltungChip({ value, className = '' }: { value: Geltung | string; className?: string }) {
|
||||
const g = normalizeGeltung(value)
|
||||
const t = GELTUNG[g]
|
||||
return (
|
||||
<span
|
||||
className={`inline-flex items-center gap-1.5 rounded-md font-publicSans font-bold ${className}`}
|
||||
style={{ background: t.bg, color: t.text, border: `1px solid ${t.border}`, padding: '3px 9px', fontSize: 11 }}
|
||||
>
|
||||
<GeltungMarker g={g} />
|
||||
{t.label}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
export function SeverityChip({ value, className = '' }: { value: Severity | string; className?: string }) {
|
||||
const s = normalizeSeverity(value)
|
||||
const t = SEVERITY[s]
|
||||
return (
|
||||
<span
|
||||
className={`inline-flex items-center rounded-[7px] font-publicSans font-bold ${className}`}
|
||||
style={{ background: t.bg, color: t.text, padding: '4px 11px', fontSize: 12 }}
|
||||
>
|
||||
{t.label}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
// Small domain tag (Safety / Cyber / Schnittstelle) — tinted, not neon.
|
||||
export function DomainTag({ value, label, className = '' }: { value: Domain; label?: string; className?: string }) {
|
||||
const d = DOMAIN[value]
|
||||
return (
|
||||
<span
|
||||
className={`inline-flex items-center rounded-md font-publicSans font-semibold ${className}`}
|
||||
style={{ background: d.tint, color: d.warn || d.accent, border: `1px solid ${d.border}`, padding: '3px 9px', fontSize: 11 }}
|
||||
>
|
||||
{label || d.label}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
// Monospace internal ID — IDs are ALWAYS secondary/nachgestellt, never a heading.
|
||||
export function MonoId({ children, className = '' }: { children: React.ReactNode; className?: string }) {
|
||||
return <span className={`font-plexMono ${className}`} style={{ fontSize: 11.5, color: '#A2A8B8' }}>{children}</span>
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
// Design-language tokens — single source of truth for the redesign.
|
||||
// Mirrors design/redesign/HANDOFF_README.md (Claude Design handoff). The same
|
||||
// values are mirrored into tailwind.config.ts (namespaces re/geltung/severity/domain)
|
||||
// for utility-class use; components that need the exact chip look import from here.
|
||||
|
||||
export const COLORS = {
|
||||
page: '#EDEFF3', surface: '#FFFFFF', border: '#E4E7EE', borderSoft: '#F0F1F5',
|
||||
ink: '#1A1D29', muted: '#5A6273', muted2: '#6B7184', faint: '#8089A0', fainter: '#9AA1B2',
|
||||
brand: '#4338CA', brandText: '#3B36B0', brandTint: '#EEF0FF', brandTint2: '#F6F4FF',
|
||||
panel: '#15182A', panelText: '#E8EAF2', panelText2: '#C7CBDA', panelAccent: '#9B8BF5',
|
||||
} as const
|
||||
|
||||
// --- Geltung: Pflicht / Empfehlung / Kann (the core 3-tier obligation system) ---
|
||||
export type Geltung = 'pflicht' | 'empfehlung' | 'kann'
|
||||
export const GELTUNG: Record<Geltung, {
|
||||
label: string; bg: string; text: string; border: string; marker: 'square' | 'diamond' | 'circle'
|
||||
}> = {
|
||||
pflicht: { label: 'Pflicht', bg: '#FBECEA', text: '#A23323', border: '#F3D2CC', marker: 'square' },
|
||||
empfehlung: { label: 'Empfehlung', bg: '#EEF0FF', text: '#3B36B0', border: '#DAD9F7', marker: 'diamond' },
|
||||
kann: { label: 'Kann', bg: '#F1F3F7', text: '#5A6273', border: '#E2E6EE', marker: 'circle' },
|
||||
}
|
||||
export const PFLICHT_MARKER = '#C0362C' // filled square color
|
||||
|
||||
export function normalizeGeltung(v: string | Geltung): Geltung {
|
||||
const s = String(v || '').toLowerCase()
|
||||
if (['pflicht', 'mandatory', 'required', 'must', 'core'].includes(s)) return 'pflicht'
|
||||
if (['empfehlung', 'recommended', 'should', 'review'].includes(s)) return 'empfehlung'
|
||||
if (['kann', 'optional', 'may', 'can'].includes(s)) return 'kann'
|
||||
return 'empfehlung' // unknown → recommendation (never silently drop; never over-state as Pflicht)
|
||||
}
|
||||
|
||||
// --- Severity (Dringlichkeit) ---
|
||||
export type Severity = 'kritisch' | 'hoch' | 'mittel' | 'niedrig'
|
||||
export const SEVERITY: Record<Severity, { label: string; bg: string; text: string }> = {
|
||||
kritisch: { label: 'Kritisch', bg: '#FBE9E7', text: '#B5362A' },
|
||||
hoch: { label: 'Hoch', bg: '#FBF1E0', text: '#9A6410' },
|
||||
mittel: { label: 'Mittel', bg: '#FAF6DD', text: '#897209' },
|
||||
niedrig: { label: 'Niedrig', bg: '#E9F5EF', text: '#2C7A52' },
|
||||
}
|
||||
export function normalizeSeverity(v: string | Severity): Severity {
|
||||
const s = String(v || '').toLowerCase()
|
||||
if (['kritisch', 'critical'].includes(s)) return 'kritisch'
|
||||
if (['hoch', 'high'].includes(s)) return 'hoch'
|
||||
if (['mittel', 'medium', 'moderate'].includes(s)) return 'mittel'
|
||||
if (['niedrig', 'low', 'minor'].includes(s)) return 'niedrig'
|
||||
return 'mittel'
|
||||
}
|
||||
|
||||
// --- Domains (Safety / Cyber / Schnittstelle) ---
|
||||
export type Domain = 'safety' | 'cyber' | 'bridge'
|
||||
export const DOMAIN: Record<Domain, { label: string; accent: string; tint: string; border: string; warn?: string }> = {
|
||||
safety: { label: 'Safety (Maschine/CE)', accent: '#0E8A66', tint: '#F3FAF7', border: '#D7ECE3' },
|
||||
cyber: { label: 'Cyber (CRA)', accent: '#6A43D6', tint: '#F6F1FE', border: '#E4D8F7' },
|
||||
bridge: { label: 'Cyber × Safety', accent: '#BE7714', tint: '#FCF6EF', border: '#F2E6D5', warn: '#9A6410' },
|
||||
}
|
||||
Reference in New Issue
Block a user