--- phase: 7 slug: mode-switcher-week-mode status: draft shadcn_initialized: false preset: none created: 2026-04-09 --- # Phase 7 — UI Design Contract > Visual and interaction contract for the mode switcher, week-mode renderer, and hours/count toggle. Generated by gsd-ui-researcher. --- ## Design System | Property | Value | |----------|-------| | Tool | none (Kimai plugin -- no shadcn) | | Preset | not applicable | | Component library | Tabler UI (bundled with Kimai) | | Icon library | none required this phase | | Font | `var(--tblr-font-sans-serif)` (inherited from Kimai/Tabler) | --- ## Spacing Scale Declared values (must be multiples of 4): | Token | Value | Usage | |-------|-------|-------| | xs | 4px | Gap between week-mode cells and labels, segmented control internal padding | | sm | 8px | Gap between mode switcher and metric toggle controls | | md | 16px | Gap between SVG area and filter dropdown (existing), stats row padding-top at 12px is the one exception | | lg | 24px | Not used this phase | | xl | 32px | Not used this phase | Exceptions: Stats row uses 12px padding-top (existing convention from `heatmap-stats`). Week-mode cell gap uses 4px between cells. --- ## Typography | Role | Size | Weight | Line Height | CSS Source | |------|------|--------|-------------|------------| | Body / Stats | 13px (0.8125rem) | 400 | 1.5 | Existing `.heatmap-stats`, `.heatmap-tooltip` | | Label (weekday, axis) | 10px | 400 | 1.2 | Existing `.heatmap-label` | | Control text (segmented buttons) | 13px (0.8125rem) | 400 (normal), 600 (active) | 1.5 | Tabler `nav-link` default | | Tooltip | 13px (0.8125rem) | 400 | 1.4 | Existing `.heatmap-tooltip` | All fonts use `var(--tblr-font-sans-serif)`. No custom font declarations. --- ## Color This phase introduces no new colors. All values come from Kimai's Tabler CSS variables and the existing heatmap color scale. | Role | Value | Usage | |------|-------|-------| | Dominant (60%) | `var(--tblr-bg-surface)` | Widget card background, tooltip background | | Secondary (30%) | `var(--tblr-bg-surface-secondary)` | Empty heatmap cells (year and week mode) | | Accent (10%) | Green scale: `#9be9a8`, `#40c463`, `#30a14e`, `#216e39` | Heatmap cells with data (both year and week modes) | | Border | `var(--tblr-border-color)` | Tooltip border | | Text primary | `var(--tblr-body-color)` | Weekday labels, stat values, control text | | Text secondary | `var(--tblr-secondary)` fallback `#6c757d` | Stats row labels | | Active control | Tabler `nav-segmented .active` default styling | Active mode/metric button background highlight | Accent reserved for: heatmap cells with tracked data only (cells colored by `buildColorScale()` quantize scale across 4 green buckets). Zero-data weekday cells use the secondary empty fill, not the lowest green bucket. --- ## Component Inventory ### 1. Mode Switcher (Segmented Control) | Property | Value | |----------|-------| | Element | `