US-002: Add TypeScript types and CSS custom properties for depth features
Add foundation types and styles for upcoming depth enhancements: TypeScript types (src/types/pmr.ts): - SkillCategory type for grouping skills - KPIStory interface for rich KPI detail content - story? field added to KPI interface - ConstellationNode and ConstellationLink for D3 career graph - DetailPanelContent discriminated union for panel routing - EducationExtra interface for expanded education detail CSS custom properties (src/index.css): - --subnav-height: 36px (section jump bar) - --panel-narrow: 400px, --panel-wide: 60vw (detail panel widths) - --backdrop-blur: 4px, --backdrop-bg (panel overlay) - @keyframes panel-slide-in, panel-slide-out, backdrop-fade-in - prefers-reduced-motion overrides for instant panel animations Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -124,6 +124,7 @@
|
|||||||
--border-light: #E4EDEB;
|
--border-light: #E4EDEB;
|
||||||
--sidebar-width: 272px;
|
--sidebar-width: 272px;
|
||||||
--topbar-height: 48px;
|
--topbar-height: 48px;
|
||||||
|
--subnav-height: 36px;
|
||||||
--radius-card: 8px;
|
--radius-card: 8px;
|
||||||
--radius-sm: 6px;
|
--radius-sm: 6px;
|
||||||
--shadow-sm: 0 1px 2px rgba(26,43,42,0.05);
|
--shadow-sm: 0 1px 2px rgba(26,43,42,0.05);
|
||||||
@@ -132,6 +133,12 @@
|
|||||||
--font-body: var(--font-ui);
|
--font-body: var(--font-ui);
|
||||||
--font-mono-dashboard: 'Geist Mono', 'Fira Code', monospace;
|
--font-mono-dashboard: 'Geist Mono', 'Fira Code', monospace;
|
||||||
|
|
||||||
|
/* Detail panel */
|
||||||
|
--panel-narrow: 400px;
|
||||||
|
--panel-wide: 60vw;
|
||||||
|
--backdrop-blur: 4px;
|
||||||
|
--backdrop-bg: rgba(26,43,42,0.15);
|
||||||
|
|
||||||
/* Legacy PMR tokens — kept for backward compat during transition (cleaned up in Task 21) */
|
/* Legacy PMR tokens — kept for backward compat during transition (cleaned up in Task 21) */
|
||||||
--pmr-content: #F0F5F4;
|
--pmr-content: #F0F5F4;
|
||||||
--pmr-card: #FFFFFF;
|
--pmr-card: #FFFFFF;
|
||||||
@@ -400,10 +407,42 @@ textarea:focus-visible {
|
|||||||
outline-offset: 0px;
|
outline-offset: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ===== DETAIL PANEL ANIMATIONS ===== */
|
||||||
|
@keyframes panel-slide-in {
|
||||||
|
from { transform: translateX(100%); }
|
||||||
|
to { transform: translateX(0); }
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes panel-slide-out {
|
||||||
|
from { transform: translateX(0); }
|
||||||
|
to { transform: translateX(100%); }
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes backdrop-fade-in {
|
||||||
|
from { opacity: 0; }
|
||||||
|
to { opacity: 1; }
|
||||||
|
}
|
||||||
|
|
||||||
@media (prefers-reduced-motion: reduce) {
|
@media (prefers-reduced-motion: reduce) {
|
||||||
/* Disable pulse animation on status badge dot */
|
/* Disable pulse animation on status badge dot */
|
||||||
@keyframes pulse {
|
@keyframes pulse {
|
||||||
0%, 100% { opacity: 1; }
|
0%, 100% { opacity: 1; }
|
||||||
50% { opacity: 1; }
|
50% { opacity: 1; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Instant panel animations */
|
||||||
|
@keyframes panel-slide-in {
|
||||||
|
from { transform: none; }
|
||||||
|
to { transform: none; }
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes panel-slide-out {
|
||||||
|
from { transform: none; }
|
||||||
|
to { transform: none; }
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes backdrop-fade-in {
|
||||||
|
from { opacity: 1; }
|
||||||
|
to { opacity: 1; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,6 +132,7 @@ export interface KPI {
|
|||||||
sub: string
|
sub: string
|
||||||
colorVariant: 'green' | 'amber' | 'teal'
|
colorVariant: 'green' | 'amber' | 'teal'
|
||||||
explanation: string
|
explanation: string
|
||||||
|
story?: KPIStory // NEW: rich detail for panel
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SkillMedication {
|
export interface SkillMedication {
|
||||||
@@ -145,3 +146,51 @@ export interface SkillMedication {
|
|||||||
status: 'Active' | 'Historical'
|
status: 'Active' | 'Historical'
|
||||||
icon: string
|
icon: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skill categories for grouped display
|
||||||
|
export type SkillCategory = 'Technical' | 'Domain' | 'Leadership'
|
||||||
|
|
||||||
|
// Extended KPI with story content for detail panel
|
||||||
|
export interface KPIStory {
|
||||||
|
context: string // What this number covers
|
||||||
|
role: string // Your role / what you did
|
||||||
|
outcomes: string[] // Key decisions or results
|
||||||
|
period?: string // Time period
|
||||||
|
}
|
||||||
|
|
||||||
|
// Constellation-specific types
|
||||||
|
export interface ConstellationNode {
|
||||||
|
id: string
|
||||||
|
type: 'role' | 'skill'
|
||||||
|
label: string
|
||||||
|
shortLabel?: string // abbreviated for small nodes
|
||||||
|
organization?: string
|
||||||
|
startYear?: number
|
||||||
|
endYear?: number | null
|
||||||
|
orgColor?: string
|
||||||
|
domain?: 'clinical' | 'technical' | 'leadership'
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ConstellationLink {
|
||||||
|
source: string
|
||||||
|
target: string
|
||||||
|
strength: number
|
||||||
|
}
|
||||||
|
|
||||||
|
// Detail panel content union
|
||||||
|
export type DetailPanelContent =
|
||||||
|
| { type: 'kpi'; kpi: KPI }
|
||||||
|
| { type: 'skill'; skill: SkillMedication }
|
||||||
|
| { type: 'skills-all'; category?: SkillCategory }
|
||||||
|
| { type: 'consultation'; consultation: Consultation }
|
||||||
|
| { type: 'project'; investigation: Investigation }
|
||||||
|
| { type: 'education'; document: Document }
|
||||||
|
| { type: 'career-role'; consultation: Consultation }
|
||||||
|
|
||||||
|
// Education extras (for detail panel)
|
||||||
|
export interface EducationExtra {
|
||||||
|
documentId: string
|
||||||
|
extracurriculars?: string[]
|
||||||
|
researchDescription?: string
|
||||||
|
programmeDetail?: string
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user