feat(frontend): switch to the dark graphite design system with a Lincodex wordmark

This commit is contained in:
shira committed 2026-10-10 02:01:39 +03:00
1 parent 945ab6d6a9
commit 3c4acff803
81 files changed
+3187 -619

No files matched your search

+60 -25
View File
@@ -8,7 +8,7 @@ A React and TypeScript SPA built with Vite and organized using FSD. Registration
- `src/pages/` holds public pages, sign-in and registration, candidate profile and questionnaire, assessment results, company and employer needs pages, candidate search, the invitation to a candidate, the candidate's incoming invitations, support cases, technical status, and remaining placeholders.
- `src/widgets/` holds shells: `public-shell`, `candidate-shell`, `employer-shell`, the result history widget `assessment-history`, the search result widget `match-list`, the invitation preview `invitation-preview`, and the technical `system-status` widget.
- `src/entities/` holds entity models, including `need` (see [Need entity](#need-entity)), `company`, and `invitation`; `src/features/` holds user actions and forms.
- `src/shared/ui/` holds design tokens, fonts, logos, and primitives; `src/shared/config/` holds route paths; `src/shared/api/` holds the API client with generated endpoints, Zod schemas, and MSW mocks.
- `src/shared/ui/` holds design tokens, fonts, the wordmark, and primitives; `src/shared/config/` holds route paths; `src/shared/api/` holds the API client with generated endpoints, Zod schemas, and MSW mocks.
- `codegen/orval.config.ts` configures generation from the shared OpenAPI contract; `codegen/mock-patterns.ts` is the step after Orval that fixes MSW mocks of strings with a `pattern` (see [API client generation](#api-client-generation)).
- `scripts/` checks FSD boundaries and Orval compatibility with the OpenAPI 3.2 fixture.
- `e2e/` holds Playwright specs and `playwright.config.ts` configures them; they run only against a Compose stack.
@@ -186,44 +186,79 @@ The server resolves the text of every item from its current source. An item with
## Tokens and theme
Tokens live in `shared/ui/theme/tokens.css`: palette, semantic colors, type scale, spacing in 4px steps, radii, lines, focus ring, content widths, and motion. Breakpoints are fixed in media queries: 360px minimum, 768px tablet (`48rem`), 1024px desktop navigation (`64rem`), and 1280px verified wide layout.
Tokens live in `shared/ui/theme/tokens.css`: palette, semantic colors, type scale, spacing in 4px steps, radii, lines, focus ring, content widths, header height, and motion. The values come from the graphite system in `docs/other/design/DESIGN.md`, except the FSP brand mark: the product is Lincodex. Breakpoints are fixed in media queries: 360px minimum, phone layout below 700px (`43.75rem`), 768px tablet (`48rem`), 1024px desktop navigation (`64rem`), and 1280px verified wide layout.
Only the light theme ships. The graphite employer sidebar is a local dark region with its own checked text, link, and focus colors. A dark theme must define and check its own pairs instead of inheriting the light accents.
One dark theme ships, and it is the default (`color-scheme: dark`). The canvas is `#1B1C21`, cards and fields are `#202129`, elevated surfaces are `#2D2E37`, boundaries are 1px hairlines, and only popover menus have a shadow. The single action color is blue `#402FFF` on primary buttons; on hover the button inverts to `#EDEDED` with blue text. Text, links, the focus ring, and selected markers use the readable accent `#9A92FF`: `#402FFF` itself reaches only 2.49 on graphite. Red `#EC1D35` is used only for 6-8px dots, error text is `#FF5A6A`, and success is `#3CCF7E`. The current section, the selected tab, and the current step are shown by inversion: a light capsule with graphite text. Every button, field, tab, and tag is a capsule; cards have a 24px radius, panels 32px, surfaces nested in a card 16px, and small objects 6px.
`app/ui/styles.css` sets the base: headings use JetBrains Mono, paragraphs and meta use Inter. Native inputs and selects get the dark capsule and padding from element rules with specificity (0,1,2): above a module rule such as `.field input`, below a state rule such as `.field input[aria-invalid]`. Field borders stay in the screen modules and use `--color-border-strong`.
WCAG 2.2 contrast of the pairs in use:
| Foreground | Background | Ratio | Use |
| ---------- | ---------- | ----- | ----------------------------------------- |
| #1B1C21 | #FFFFFF | 17.01 | Text on surfaces |
| #1B1C21 | #EDEDED | 14.53 | Text on the canvas |
| #2D2E37 | #FFFFFF | 13.48 | Secondary text |
| #2D2E37 | #EDEDED | 11.52 | Secondary text on the canvas |
| #402FFF | #FFFFFF | 6.84 | Links, active navigation, focus ring |
| #402FFF | #EDEDED | 5.85 | Labels and links on the canvas |
| #FFFFFF | #402FFF | 6.84 | Primary button, skip link |
| #EDEDED | #1B1C21 | 14.53 | Employer sidebar text |
| #FFFFFF | #1B1C21 | 17.01 | Active item and focus ring in the sidebar |
| #EC1D35 | #FFFFFF | 4.38 | Error graphics only (needs 3:1) |
| #FFFFFF | #EC1D35 | 4.38 | Glyph inside the error mark (graphic) |
| Foreground | Background | Ratio | Use |
| ---------- | ---------- | ----- | ----------------------------------------------------------- |
| #EDEDED | #1B1C21 | 14.53 | Text on the canvas |
| #EDEDED | #202129 | 13.68 | Text on cards, fields, and the header |
| #EDEDED | #2D2E37 | 11.52 | Secondary button, menus |
| #FFFFFF | #1B1C21 | 17.01 | Headings on the canvas |
| #FFFFFF | #202129 | 16.02 | Card titles, salary |
| #FFFFFF | #414246 | 10.04 | Secondary button on hover |
| #9B9C9E | #1B1C21 | 6.19 | Secondary text, meta |
| #9B9C9E | #202129 | 5.83 | Secondary text on cards |
| #9B9C9E | #2D2E37 | 4.91 | Secondary text on the elevated surface |
| #878994 | #1B1C21 | 4.89 | Hints and placeholders |
| #878994 | #202129 | 4.60 | Field placeholders |
| #9A92FF | #1B1C21 | 6.42 | Links, accent labels, focus ring |
| #9A92FF | #202129 | 6.05 | Links and focus ring on cards |
| #9A92FF | #2D2E37 | 5.09 | Links and focus in menus |
| #FFFFFF | #402FFF | 6.84 | Primary button, skip link |
| #FFFFFF | #3324E0 | 8.50 | Primary button when pressed |
| #402FFF | #EDEDED | 5.85 | Primary button on hover (inversion) |
| #1B1C21 | #EDEDED | 14.53 | Current section, selected tab, current step |
| #1B1C21 | #9A92FF | 6.42 | Completed step, text selection |
| #FF5A6A | #1B1C21 | 5.61 | Error text |
| #FF5A6A | #202129 | 5.28 | Error text on cards |
| #FF5A6A | #30212A | 5.03 | Text in the error box (8% red over #202129) |
| #9B9C9E | #30212A | 5.55 | Description in the error box |
| #FF5A6A | #41202B | 4.72 | Error tag (16% red over #202129) |
| #3CCF7E | #1B1C21 | 8.44 | Success: saved, confirmed |
| #3CCF7E | #243935 | 6.09 | Success tag (14% green over #202129) |
| #9A92FF | #262450 | 5.47 | Accent tag (18% blue over #202129) |
| #9B9C9E | #2C2D35 | 4.98 | Neutral tag (6% paper over #202129) |
| #EDEDED | #34353D | 10.41 | Stack tag (10% paper over #202129) |
| #EDEDED | #1F2028 | 13.85 | Text on the glass header (88% #202129 over the canvas) |
| #73757F | #1B1C21 | 3.71 | Field and control boundary (needs 3:1) |
| #73757F | #202129 | 3.49 | Field boundary on cards (needs 3:1) |
| #1B1C21 | #FF5A6A | 5.61 | Glyph inside the error mark (graphic) |
| #EC1D35 | #1B1C21 | 3.88 | Red "new" or "live" dot (graphic, meaning repeated in text) |
Excluded pairs: red is not used for body text (4.38 is below 4.5); #402FFF on #1B1C21 (2.49) and on #2D2E37 (1.97) is not used; grey #C8C9CA (1.66 on white) is only for decorative dividers.
Excluded pairs: `#402FFF` is not used as text or as a boundary on graphite (2.49 on `#1B1C21`); `#878994` and `#FF5A6A` are not used on `#2D2E37` (3.88 and 4.44); the `#2D2E37` hairline on the canvas (1.26) is decorative only and is never the only boundary of a control.
## Fonts and logos
## Fonts and wordmark
JetBrains Mono 2.304 (SIL OFL 1.1) is self-hosted from `requirements/brandbook/`: regular and bold woff2 files plus the license and authors list live in `shared/ui/theme/fonts/`. The font is used through `Mono` for numbers, scores, codes, and pseudonyms. Text uses the system font stack: Unbounded and Golos Text are not added, because their files and licenses are not in the repository.
All fonts are self-hosted (`font-src 'self'`) under the SIL Open Font License 1.1; licenses, authors, sources, and character ranges are in `shared/ui/theme/fonts/` (`SOURCES.txt`). The files are subsets made with fontTools:
The header uses the FSP brandbook logo: `logo_02w.svg` on light backgrounds and `logo_01.svg` on the graphite sidebar, unchanged, with the product name beside it.
- JetBrains Mono 2.304 from the brandbook archive, variable weight 400-700: headings, navigation, buttons, labels, numbers, grades, stack, codes; `Mono` adds tabular figures.
- Inter 4.001 from the Google Fonts repository, variable weight 400-700, Latin and Cyrillic: paragraphs, meta, form fields.
- Unbounded 1.701 from the Google Fonts repository, Latin only, used only for the wordmark. The wide geometric face sets the name apart from interface text, which is set in mono and Inter.
The interface has no FSP logo. `Wordmark` is the text mark "Lincodex" with a terminal caret in the action color; the link's accessible name is exactly "Lincodex", the caret is decorative, and the cabinet name sits next to the link. The tab icon `public/favicon.svg` is an L with a caret on a blue square.
## Shared components
- `Page`, `Section`, `Stack`: page layout; `Page` owns the only `h1` and the document title.
- `Button`, `ButtonLink`, `TextLink`, `NavItem`: controls with text labels; `NavItem` marks the active section with `aria-current`, a bar, and weight.
- `StatusView`, `LoadingState`, `EmptyState`, `ErrorState`, `ForbiddenState`, `SavingStatus`: screen states. Each state has its own shape and text. `ErrorState` shows the code, status, server text, and request ID as plain text and offers a retry.
- `Page`, `Section`, `Stack`: page layout; `Page` owns the only `h1` and the document title. `Section` hangs on a circuit trace: a node at the heading and a line down the section.
- `Button`, `ButtonLink` (variants `primary`, `secondary`, `quiet`), `TextLink`, `NavItem`: controls with text labels; `NavItem` marks the active section with `aria-current` and an inverted capsule.
- `HeaderPlate`, `MenuButton`, `useMenuToggle`, `Wordmark`: the shell header: a floating glass plate, a menu button with `aria-expanded` (the menu closes after a navigation and on Escape, and focus returns to the button), and the wordmark.
- `Card` (`raised`, `inset`, `panel`), `Tag` (`neutral`, `grade`, `stack`, `accent`, `success`, `danger`), `AttentionDot`, `Notice`: containers, tags, and messages. The meaning is always given in text; color only repeats it.
- `Stepper` and `buildSteps`: progress through a multi-step flow: a "Шаг N из M" line and a list with `aria-current="step"` and a text status for each step.
- `Tabs` (WAI-ARIA tabs pattern, arrow keys, Home and End; inactive panels stay mounted with the hidden attribute, so form state survives) and `SegmentedControl` (a native radio group drawn as capsules).
- `StatusView`, `LoadingState`, `EmptyState`, `ErrorState`, `ForbiddenState`, `SavingStatus`: screen states. Each state has its own shape and text; the empty state draws a circuit trace that ends at an open node. `ErrorState` shows the code, status, server text, and request ID as plain text and offers a retry. `Skeleton`: decorative placeholder lines while loading, always next to a loading message.
- `QueryView`: maps a query result to loading, error, forbidden (401 and 403 without retry), empty, or data.
- `TrustLevel`: an empty mark, ring, partial fill, or full mark with a visible label.
- `Mono`, `VisuallyHidden`, `SkipLink`, `MainRegion`, `BrandLogo`.
- `CircuitTrace`, `Mono`, `VisuallyHidden`, `SkipLink`, `MainRegion`.
Accessibility: every shell starts with a skip link to `main`, has landmarks and a visible focus ring, and moves focus to `main` after navigation. Animations respect `prefers-reduced-motion`.
Shells. Public: a floating plate with the wordmark and links; below 700px the links open from a "Меню" button; a footer links the technical status. Candidate (phone first): below 700px the sections form a scrolling bottom tab bar and the current tab scrolls to the middle; from 700px the tabs sit in the plate. The navigation comes before `main` in the document, so the keyboard order is the same at every width. Employer (desktop first): from 1024px a floating 240px sidebar, below that a plate with a "Меню" button.
Accessibility: every shell starts with a skip link to `main`, has landmarks and a visible focus ring (2px `#9A92FF`, 2px offset), and moves focus to `main` after navigation. Animations respect `prefers-reduced-motion`.
## Tests