עיצוב ואינטראקציה
Design System
יסודות העיצוב, חוזי רכיבים, נגישות, RTL וכללי שימוש.
בעמוד הזה
Live library: /design-system. This release establishes a reusable visual language and UI primitives before backend integration. It does not imply that every existing screen has already migrated, or that the entire product has passed a WCAG audit.
Product direction#
Electric Clarity: vivid indigo for action, midnight for navigation, electric lime for energy, and cyan/coral/amber for supporting roles. The full visual language is documented at /visual-system and docs/visual-system.md. The dashboard and driver pages now use the same 90-token system. Legacy forest/sand token names remain as compatibility values.
Source of truth#
styles/tokens.css: primitive and semantic CSS variables, spacing, radii, elevation, typography, motion and layers.styles/components.css: reusable component styles, prefixedev-.components/ui/index.tsx: Button, Badge, Field, Toggle, Alert, Progress, Tabs, Dialog and Skeleton. Together with the semantic token layer these form the foundation; there are nine named UI component exports.components/design-system.tsx: live specifications and interactive examples. Charging cards, history table, icon grid, layout and metric patterns are composed examples rather than additional exported primitives./design-system/tokens.json: downloadable CSS-token mapping, not a Figma or DTCG import file. Keep synchronized with CSS; reduced-motion overrides belong only to the CSS media query.
Foundations#
Typography: Heebo for Hebrew, Manrope for numeric displays. Base body 16px/1.8, labels 14px/1.5, supporting text 12px/1.6. Display sizes are responsive. Use tabular numbers for changing values. Fonts currently load from Google Fonts with Arial fallback; production self-hosting is a separate packaging step.
Spacing uses a 4px base with 4/8/12/16/20/24/32/40/48/64/96px steps. Container radii 20–28px, controls 12px, compact items 8px. Elevation has three levels; shadows indicate hierarchy rather than decorate every element.
Breakpoints: mobile below 640px, tablet 640–1023px, desktop from 1024px. Grid patterns: 4/8/12 columns. Some library navigation/layout changes happen at 600/850/1150px to protect content. Prefer content-driven breakpoints for compositions.
Component contracts#
| Component | Variants / behavior |
|---|---|
| Button | primary, secondary, ghost, danger, accent; sm/md/lg; loading disables duplicate action; default type=button |
| Badge | neutral, success, warning, danger, info; always includes visible text |
| Field | explicit label, optional hint/error, aria-describedby and aria-invalid; native input types/required |
| Toggle | controlled switch, named by visible label, native keyboard button interaction |
| Alert | success/info/warning use status; danger uses alert; keep live regions sparse in real screens |
| Progress | controlled percentage, clamped 0–100, semantic progressbar, visible value |
| Tabs | controlled selection, roving focus, direction-aware arrows and Home/End; associate product-specific panels when used in full tabbed views |
| Dialog | native modal dialog, Escape/backdrop dismissal, focus containment and restoration; no nested dialogs |
| Skeleton | status label, reduced-motion behavior; replace when content resolves |
Do not combine a dangerous action with the primary indigo appearance. Loading labels should name the process. Keep icon-only actions named and at least 44×44px. Error messages explain the correction rather than repeat an error code.
EV charging patterns#
- Available: green + text. Charging: blue + text. Occupied/waiting: amber. Unavailable: red. Unknown/stale: neutral with a freshness label when actual data exists.
- Show connector type, maximum power, available/total count, price unit and distance source before confirming a session.
- Show battery percent, energy in kWh, elapsed time, rate and estimated/final price as distinct values. Never infer real payment success from a visual simulation.
- Use a confirmation dialog for ending a session; final receipt depends on confirmed backend events.
- Real-time stale data, disconnected charging, retry/recovery, authorization failure, payment pending/failed and receipt reconciliation remain explicit product states to implement with the backend.
- Empty/error/loading examples, station cards, charts of progress and tables in the library use illustration data, not live billing records.
Accessibility and RTL#
Target WCAG 2.2 AA: normal text 4.5:1, large text and meaningful control boundaries 3:1. Token contrast tests cover named pairs; a full screen-reader and product accessibility audit remains necessary. Visible focus is a two-ring treatment; do not remove outlines without a replacement.
Preserve natural Hebrew reading order; use logical margin/padding properties. Use bdi or dir=ltr for mixed numeric units, prices, identifiers and car plates. Mirror navigation direction, not brand/charging symbols. Respect prefers-reduced-motion and support 200% text zoom without losing actions.
Content#
Hebrew is direct, calm and specific. Prefer “לא הצלחנו להתחבר לעמדה. בדקו את חיבור הכבל ונסו שוב.” over “שגיאה 500”. Say what is known, what happens next and whether a price is estimated. Demo mode remains visible throughout the current app.
Adoption and governance#
- Apply shared Button/Field/Dialog and type hierarchy to discovery and station details.
- Migrate vehicle, favorites and history to the same components and responsive rules.
- Build full loading, empty, offline, stale-data and payment states before backend wiring.
- Validate keyboard, contrast, mobile, zoom and screen-reader behavior with each migrated flow.
- Add authenticated data, charging and payment integrations after UI states and contracts stabilize.
Use semantic tokens rather than raw colors in new reusable components. New variants require a real repeated need, usage guidance, interactive example and appropriate behavioral checks. Breaking token/prop changes require a major foundation version; additions a minor version; fixes a patch. This is a versioned foundation for further refinement, not a declaration of a finished production UI.