Files
breakpilot-compliance/admin-compliance/components/redesign/Chips.tsx
T
Benjamin Bönisch 42d4b4d9c5
CI / detect-changes (push) Successful in 19s
CI / branch-name (push) Has been skipped
CI / guardrail-integrity (push) Has been skipped
CI / secret-scan (push) Has been skipped
CI / dep-audit (push) Has been skipped
CI / sbom-scan (push) Has been skipped
CI / build-sha-integrity (push) Successful in 7s
CI / validate-canonical-controls (push) Successful in 4s
CI / loc-budget (push) Successful in 21s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / nodejs-build (push) Successful in 3m13s
CI / test-go (push) Has been skipped
CI / iace-gt-coverage (push) Has been skipped
CI / test-python-backend (push) Has been skipped
CI / test-python-document-crawler (push) Has been skipped
CI / test-python-dsms-gateway (push) Has been skipped
feat(redesign): Design-Tokens + Ebene-2 "Cyber trifft Safety" (additiv)
Schritt A (Tokens): zentrale Design-Sprache aus dem Claude-Design-Handoff —
Tailwind-Tokens (re/geltung/severity/domain) + Fonts (Public Sans / Source
Serif 4 / IBM Plex Mono) + components/redesign/{tokens.ts,Chips.tsx}
(GeltungChip, SeverityChip, DomainTag, MonoId) + Showcase /sdk/design-system.
Bestehende Farben/sans unangetastet.

Schritt B (Ebene 2): CyberMeetsSafety als USP-Hero im CRA/Cyber-Tab
(/sdk/iace/[id]/cra) — Domaenen-Bar, Hazard-Karten (CE-gemildert -> Cyber-Befund
-> Restrisiko, Warum-Box, Pflicht/Empfehlung-Massnahmen, aufklappbarer
Norm-Bezug), Massnahmen-Backlog mit Geltung-Filter. Gebunden an echte
cross_links/findings/open_measures. Bisheriger CRACyberView bleibt eingeklappt
erhalten -> kein Inhaltsverlust.

Guardrail-Doku: design/redesign/ (HANDOFF_README, CONTENT_INVENTORY mit
40-Screen-Mapping + Waisen-Liste, Arbeitsbereich.dc.html-Referenz).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-18 16:49:04 +02:00

65 lines
2.5 KiB
TypeScript

'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>
}