Repository Public MIT
1<!--2ORIX Calc3File: docs/design/design-system.md4Author: Simon-Pierre Boucher5Contact: contact@spboucher.ai6-->7# ORIX design system (as implemented in `Packages/ORIXUI`)89The design system is code, not a mock-up: tokens and components live in `ORIXUI` and every environment is built from them.1011## Tokens (`Tokens/Tokens.swift`)1213| Group | API | Notes |14|---|---|---|15| Colour | `ORIXColor.background / surface / surfaceRaised / hairline / textPrimary / textSecondary / textTertiary` | Adaptive light / dark; shared with ORIX Scan |16| Keys | `ORIXColor.keyDigit / keyFunction / keyPressed` | Digit keys are the lightest surface, function keys one step darker |17| Brand | `ORIXColor.brandViolet / brandIndigo / brandCyan / brandGradient` | Icon, primary emphasis |18| Semantic | `success / warning / failure / finance` | Each has a light and a dark value chosen for text contrast on its background |19| Series | `ORIXColor.series` (8) | Graph and chart palette, distinguishable in both appearances |20| Spacing | `ORIXSpacing.xxs…xxl` = 2, 4, 8, 12, 16, 24, 32 | |21| Radius | `ORIXRadius.key 20 / card 22 / chip 12 / field 12` | Continuous corners |22| Motion | `ORIXMotion.press / mode / value` | Springs of 0.22 s and 0.38 s; value changes ease out in 0.18 s |23| Type | `ORIXFont.display(size) / expression / key / value / valueEmphasis / mono` | System fonts only; every numeric style uses monospaced digits so values do not jitter |2425## Environment identity (`Core/CalcMode.swift`)2627| Environment | Symbol | Tint (light / dark) |28|---|---|---|29| Standard | `plus.forwardslash.minus` | `#4F46E5` / `#818CF8` |30| Scientific | `function` | `#7C3AED` / `#A78BFA` |31| Financial | `chart.line.uptrend.xyaxis` | `#B45309` / `#F59E0B` |32| Graph | `point.topleft.down.to.point.bottomright.curvepath` | `#0E7490` / `#22D3EE` |33| Math | `x.squareroot` | `#BE185D` / `#F472B6` |34| Statistics | `chart.bar.xaxis` | `#15803D` / `#34D399` |35| Convert | `arrow.left.arrow.right` | `#0F766E` / `#2DD4BF` |36| Workspace | `square.grid.3x1.below.line.grid.1x2` | `#C2410C` / `#FB923C` |3738The tint is the only thing that changes between environments: layout grammar, typography and neutrals stay constant.3940## Components4142| Component | Purpose |43|---|---|44| `KeyButton`, `Keypad`, `KeySpec` | Calculator keys with roles (digit, function, operation, accent, destructive), long-press alternates, haptics, VoiceOver labels, and a grid whose rows align to both edges even with different key counts |45| `ORIXCard`, `ORIXPage` | Card surface with an optional uppercase section header; a scrolling page with readable width |46| `ResultRow` | Label + value; tap to select, long-press for Quick Actions (copy, use in calculator, save to workspace, convert, explain, share) |47| `NumberField` | Numeric input that accepts either a number in the device locale or any expression (`1200*12`), evaluated by the shared engine |48| `PillPicker` | Horizontal single-selection pills |49| `MessageBanner` | Error / warning / information with an icon, never colour alone |50| `PrimaryButton` | The one main action of a form |51| `VerifiedBadge` | Renders only when a verification report contains checks |52| `ResultDetailView` | ORIX Explain sheet: formula, inputs, steps, result, assumptions, executed checks |5354## Layout rules5556- **iPhone**: one column. The mode strip is always on screen; the active environment's chip expands to show its name.57- **iPad**: a sidebar that collapses to an icon rail but never disappears, an optional companion calculator pane, and58 environment layouts with two or three zones. The Standard and Scientific calculators keep a hand-sized keypad59 (maximum width 520 pt) next to the history instead of stretching across the screen.60- Touch targets are at least 44 × 44 pt, except keys in the densest scientific rows, which keep at least 28 pt of height on61 the smallest supported phone and scale up with the screen.6263## Haptics6465Light impact on key press, rigid impact on "=", selection feedback on mode and picker changes, notification feedback on66errors and on successful store / copy. All haptics follow the user's setting.67