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

+1 -1
View File
@@ -141,7 +141,7 @@ S3 storage connects through the outbound `ObjectStorage` port and `backend/inter
The frontend is a React/Vite SPA. Keep FSD boundaries as product screens are added.
Implemented frontend scaffold: a React Router data router with public routes and separate candidate and employer cabinet shells, a TanStack Query client over the shared same-origin `apiRequest`, brand tokens in CSS variables, and shared primitives for loading, empty, error, forbidden, and saving states. JetBrains Mono 2.304 is self-hosted from the brandbook with its OFL license. Sign-in, registration, email confirmation, support, and cabinet screens are placeholders; business screens are later tasks. /status is a technical API liveness page, not product readiness. Vitest runs in the Node environment without a DOM. The Playwright suite in `frontend/e2e/` loads pages in Chromium but does not yet test interactions, so clicks and keyboard focus are verified manually in a browser until it covers them. See [frontend/README.en.md](../../frontend/README.en.md). Generated transport types are not automatically entity models. MSW supports UI development; its fixtures do not prove that the API is implemented.
Implemented frontend scaffold: a React Router data router with public routes and separate candidate and employer cabinet shells, a TanStack Query client over the shared same-origin `apiRequest`, dark graphite theme tokens in CSS variables, and shared primitives for loading, empty, error, forbidden, and saving states. JetBrains Mono, Inter, and Unbounded (for the Lincodex wordmark) are self-hosted with their OFL licenses. Sign-in, registration, email confirmation, support, and cabinet screens are placeholders; business screens are later tasks. /status is a technical API liveness page, not product readiness. Vitest runs in the Node environment without a DOM. The Playwright suite in `frontend/e2e/` loads pages in Chromium but does not yet test interactions, so clicks and keyboard focus are verified manually in a browser until it covers them. See [frontend/README.en.md](../../frontend/README.en.md). Generated transport types are not automatically entity models. MSW supports UI development; its fixtures do not prove that the API is implemented.
ML runs as a separate FastAPI process. It currently provides operational health/readiness only. Readiness stays at 503 without a model. Do not add placeholder inference that looks like a real result.
+1 -1
View File
@@ -141,7 +141,7 @@ S3-хранилище подключено через outbound-порт `ObjectS
Frontend строится как React/Vite SPA. При разработке продуктовых экранов соблюдайте FSD границы.
Реализованный каркас frontend: data router React Router с публичными маршрутами и отдельными оболочками кабинетов кандидата и работодателя, клиент TanStack Query поверх общего `apiRequest` того же origin, токены бренда в CSS variables и общие примитивы состояний загрузки, пустого результата, ошибки, запрета доступа и сохранения. JetBrains Mono 2.304 раздается с нашего сервера из брендбука вместе с лицензией OFL. Вход, регистрация, подтверждение почты, поддержка и экраны кабинетов - заготовки; бизнес-экраны делаются отдельными задачами. /status - техническая страница доступности API, а не показатель готовности продукта. Vitest работает в окружении Node без DOM. Набор Playwright в `frontend/e2e/` открывает страницы в Chromium, но пока не проверяет взаимодействия, поэтому нажатия и фокус клавиатуры проверяются вручную в браузере, пока набор их не покрывает. Подробнее: [frontend/README.md](../../frontend/README.md). Generated API transport не превращается в entity model сам по себе. MSW полезен для интерфейсной разработки, но его fixture не подтверждает API реализации.
Реализованный каркас frontend: data router React Router с публичными маршрутами и отдельными оболочками кабинетов кандидата и работодателя, клиент TanStack Query поверх общего `apiRequest` того же origin, токены темной графитовой темы в CSS variables и общие примитивы состояний загрузки, пустого результата, ошибки, запрета доступа и сохранения. Шрифты JetBrains Mono, Inter и Unbounded (для словесного знака Lincodex) раздаются с нашего сервера вместе с лицензиями OFL. Вход, регистрация, подтверждение почты, поддержка и экраны кабинетов - заготовки; бизнес-экраны делаются отдельными задачами. /status - техническая страница доступности API, а не показатель готовности продукта. Vitest работает в окружении Node без DOM. Набор Playwright в `frontend/e2e/` открывает страницы в Chromium, но пока не проверяет взаимодействия, поэтому нажатия и фокус клавиатуры проверяются вручную в браузере, пока набор их не покрывает. Подробнее: [frontend/README.md](../../frontend/README.md). Generated API transport не превращается в entity model сам по себе. MSW полезен для интерфейсной разработки, но его fixture не подтверждает API реализации.
ML - отдельный FastAPI процесс. Сейчас он предоставляет только operational health/readiness. Readiness остается 503 без модели. Не добавляйте placeholder inference, который выглядит как рабочий результат.
+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
+60 -25
View File
@@ -8,7 +8,7 @@ SPA на React и TypeScript со сборкой Vite и структурой FS
- `src/pages/` - публичные страницы, вход и регистрация, профиль и анкета кандидата, результаты проверок, компания и потребности работодателя, подбор кандидатов, приглашение кандидату, входящие приглашения кандидата, обращения в поддержку, технический статус и оставшиеся заготовки экранов.
- `src/widgets/` - оболочки: `public-shell`, `candidate-shell`, `employer-shell`, виджет истории результатов `assessment-history`, виджет выдачи подбора `match-list`, предпросмотр приглашения `invitation-preview` и технический виджет `system-status`.
- `src/entities/` - модели сущностей, в том числе `need` (см. [сущность потребности](#сущность-потребности)), `company` и `invitation`; `src/features/` - действия пользователя и формы.
- `src/shared/ui/` - токены дизайна, шрифты, логотипы и примитивы; `src/shared/config/` - пути маршрутов; `src/shared/api/` - API-клиент со сгенерированными endpoints, схемами Zod и MSW-моками.
- `src/shared/ui/` - токены дизайна, шрифты, словесный знак и примитивы; `src/shared/config/` - пути маршрутов; `src/shared/api/` - API-клиент со сгенерированными endpoints, схемами Zod и MSW-моками.
- `codegen/orval.config.ts` - генерация из общего OpenAPI-контракта; `codegen/mock-patterns.ts` - шаг после Orval, который исправляет MSW-моки строк с `pattern` (см. [генерацию API-клиента](#генерация-api-клиента)).
- `scripts/` - проверки границ FSD и совместимости Orval с фикстурой OpenAPI 3.2.
- `e2e/` - спецификации Playwright, их настройки в `playwright.config.ts`; запускаются только на Compose-стеке.
@@ -186,44 +186,79 @@ SPA на React и TypeScript со сборкой Vite и структурой FS
## Токены и тема
Токены лежат в `shared/ui/theme/tokens.css`: палитра, семантические цвета, шкала шрифтов, отступы с шагом 4px, радиусы, линии, кольцо фокуса, ширины контента и анимация. Точки перелома зафиксированы в media-запросах: минимум 360px, планшет 768px (`48rem`), навигация для компьютера 1024px (`64rem`) и проверенная широкая ширина 1280px.
Токены лежат в `shared/ui/theme/tokens.css`: палитра, семантические цвета, шкала шрифтов, отступы с шагом 4px, радиусы, линии, кольцо фокуса, ширины контента, высота шапки и анимация. Значения взяты из графитовой системы `docs/other/design/DESIGN.md`, кроме фирменного знака ФСП: продукт называется Lincodex. Точки перелома зафиксированы в media-запросах: минимум 360px, телефонная раскладка до 700px (`43.75rem`), планшет 768px (`48rem`), навигация для компьютера 1024px (`64rem`) и проверенная широкая ширина 1280px.
Поставляется только светлая тема. Графитовая боковая панель работодателя - локальная темная область со своими проверенными цветами текста, ссылок и фокуса. Темная тема должна задать и проверить свои пары, а не наследовать светлые акценты.
Поставляется одна темная тема, она же тема по умолчанию (`color-scheme: dark`). Холст `#1B1C21`, карточки и поля `#202129`, приподнятые поверхности `#2D2E37`, границы - линии в 1px, тень есть только у всплывающих меню. Единственный цвет действия - синий `#402FFF` на основных кнопках; при наведении кнопка инвертируется в `#EDEDED` с синим текстом. Текст, ссылки, кольцо фокуса и выбранные метки используют читаемый акцент `#9A92FF`: сам `#402FFF` на графите дает только 2.49. Красный `#EC1D35` - только точки 6-8px, текст ошибок - `#FF5A6A`, успех - `#3CCF7E`. Текущий раздел, выбранная вкладка и текущий шаг показаны инверсией: светлая капсула с графитовым текстом. Все кнопки, поля, вкладки и метки - капсулы, карточки скруглены на 24px, панели на 32px, вложенные поверхности на 16px, мелкие объекты на 6px.
`app/ui/styles.css` задает базу: заголовки набраны JetBrains Mono, абзацы и мета - Inter. Нативные поля ввода и списки получают темную капсулу и отступы правилами элементов со специфичностью (0,1,2): выше правила модуля вроде `.field input`, ниже правил состояния вроде `.field input[aria-invalid]`. Границы полей остаются в модулях экранов и используют `--color-border-strong`.
Контраст используемых пар по WCAG 2.2:
| Текст | Фон | Контраст | Где |
| ------- | ------- | -------- | ----------------------------------------- |
| #1B1C21 | #FFFFFF | 17.01 | Текст на поверхностях |
| #1B1C21 | #EDEDED | 14.53 | Текст на фоне страницы |
| #2D2E37 | #FFFFFF | 13.48 | Второстепенный текст |
| #2D2E37 | #EDEDED | 11.52 | Второстепенный текст на фоне страницы |
| #402FFF | #FFFFFF | 6.84 | Ссылки, активная навигация, кольцо фокуса |
| #402FFF | #EDEDED | 5.85 | Метки и ссылки на фоне страницы |
| #FFFFFF | #402FFF | 6.84 | Основная кнопка, ссылка пропуска |
| #EDEDED | #1B1C21 | 14.53 | Текст боковой панели работодателя |
| #FFFFFF | #1B1C21 | 17.01 | Активный пункт и кольцо фокуса в панели |
| #EC1D35 | #FFFFFF | 4.38 | Только графика ошибок (нужно 3:1) |
| #FFFFFF | #EC1D35 | 4.38 | Знак внутри метки ошибки (графика) |
| Текст | Фон | Контраст | Где |
| ------- | ------- | -------- | ----------------------------------------------------------------- |
| #EDEDED | #1B1C21 | 14.53 | Текст на холсте |
| #EDEDED | #202129 | 13.68 | Текст на карточках, полях и шапке |
| #EDEDED | #2D2E37 | 11.52 | Вторичная кнопка, меню |
| #FFFFFF | #1B1C21 | 17.01 | Заголовки на холсте |
| #FFFFFF | #202129 | 16.02 | Заголовки карточек, зарплата |
| #FFFFFF | #414246 | 10.04 | Вторичная кнопка при наведении |
| #9B9C9E | #1B1C21 | 6.19 | Вторичный текст, мета |
| #9B9C9E | #202129 | 5.83 | Вторичный текст на карточках |
| #9B9C9E | #2D2E37 | 4.91 | Вторичный текст на приподнятой поверхности |
| #878994 | #1B1C21 | 4.89 | Подсказки и плейсхолдеры |
| #878994 | #202129 | 4.60 | Плейсхолдеры полей |
| #9A92FF | #1B1C21 | 6.42 | Ссылки, акцентные метки, кольцо фокуса |
| #9A92FF | #202129 | 6.05 | Ссылки и кольцо фокуса на карточках |
| #9A92FF | #2D2E37 | 5.09 | Ссылки и фокус в меню |
| #FFFFFF | #402FFF | 6.84 | Основная кнопка, ссылка пропуска |
| #FFFFFF | #3324E0 | 8.50 | Основная кнопка при нажатии |
| #402FFF | #EDEDED | 5.85 | Основная кнопка при наведении (инверсия) |
| #1B1C21 | #EDEDED | 14.53 | Текущий раздел, выбранная вкладка, текущий шаг |
| #1B1C21 | #9A92FF | 6.42 | Выполненный шаг, выделение текста |
| #FF5A6A | #1B1C21 | 5.61 | Текст ошибок |
| #FF5A6A | #202129 | 5.28 | Текст ошибок на карточках |
| #FF5A6A | #30212A | 5.03 | Ошибка в блоке ошибки (8% красного на #202129) |
| #9B9C9E | #30212A | 5.55 | Пояснение в блоке ошибки |
| #FF5A6A | #41202B | 4.72 | Метка ошибки (16% красного на #202129) |
| #3CCF7E | #1B1C21 | 8.44 | Успех: сохранено, подтверждено |
| #3CCF7E | #243935 | 6.09 | Метка успеха (14% зеленого на #202129) |
| #9A92FF | #262450 | 5.47 | Акцентная метка (18% синего на #202129) |
| #9B9C9E | #2C2D35 | 4.98 | Нейтральная метка (6% светлого на #202129) |
| #EDEDED | #34353D | 10.41 | Метка стека (10% светлого на #202129) |
| #EDEDED | #1F2028 | 13.85 | Текст на стеклянной шапке (88% #202129 на холсте) |
| #73757F | #1B1C21 | 3.71 | Граница полей и элементов управления (нужно 3:1) |
| #73757F | #202129 | 3.49 | Граница полей на карточках (нужно 3:1) |
| #1B1C21 | #FF5A6A | 5.61 | Знак внутри метки ошибки (графика) |
| #EC1D35 | #1B1C21 | 3.88 | Красная точка "новое", "live" (графика, смысл дублирован текстом) |
Исключенные пары: красный не используется для основного текста (4.38 меньше 4.5); #402FFF на #1B1C21 (2.49) и на #2D2E37 (1.97) не используется; серый #C8C9CA (1.66 на белом) - только для декоративных разделителей.
Исключенные пары: `#402FFF` не используется как текст или граница на графите (2.49 на `#1B1C21`); `#878994` и `#FF5A6A` не используются на `#2D2E37` (3.88 и 4.44); волосяная линия `#2D2E37` на холсте (1.26) только декоративна и не является единственной границей элемента управления.
## Шрифты и логотипы
## Шрифты и словесный знак
JetBrains Mono 2.304 (SIL OFL 1.1) раздается с нашего сервера из `requirements/brandbook/`: файлы woff2 обычного и жирного начертания, текст лицензии и список авторов лежат в `shared/ui/theme/fonts/`. Шрифт применяется через `Mono` для чисел, баллов, кодов и псевдонимов. Для текста используется системный набор шрифтов: Unbounded и Golos Text не добавлены, потому что их файлов и лицензий нет в репозитории.
Все шрифты раздаются с нашего сервера (`font-src 'self'`), лицензия SIL OFL 1.1; лицензии, авторы, источники и диапазоны символов лежат в `shared/ui/theme/fonts/` (`SOURCES.txt`). Файлы - подмножества, собранные fontTools:
В шапке используется логотип ФСП из брендбука без изменений: `logo_02w.svg` на светлом фоне и `logo_01.svg` на графитовой панели, рядом - название продукта.
- JetBrains Mono 2.304 из архива брендбука, переменный вес 400-700: заголовки, навигация, кнопки, метки, числа, грейды, стек, коды; `Mono` добавляет табличные цифры.
- Inter 4.001 из репозитория Google Fonts, переменный вес 400-700, латиница и кириллица: абзацы, мета, поля форм.
- Unbounded 1.701 из репозитория Google Fonts, только латиница, только словесный знак. Широкий геометрический гротеск отличает название от текста интерфейса, который набран моноширинным шрифтом и Inter.
Логотипа ФСП в интерфейсе нет. `Wordmark` - текстовый знак "Lincodex" с курсором терминала цвета действия; доступное имя ссылки ровно "Lincodex", курсор декоративен, а название кабинета стоит рядом со ссылкой. Иконка вкладки `public/favicon.svg` - буква L с курсором на синем квадрате.
## Общие компоненты
- `Page`, `Section`, `Stack` - раскладка страницы; `Page` содержит единственный `h1` и задает заголовок документа.
- `Button`, `ButtonLink`, `TextLink`, `NavItem` - элементы управления с текстовыми подписями; `NavItem` отмечает активный раздел через `aria-current`, полосу и насыщенность.
- `StatusView`, `LoadingState`, `EmptyState`, `ErrorState`, `ForbiddenState`, `SavingStatus` - состояния экранов. У каждого состояния своя форма и текст. `ErrorState` показывает код, статус, текст сервера и идентификатор запроса как обычный текст и предлагает повтор.
- `Page`, `Section`, `Stack` - раскладка страницы; `Page` содержит единственный `h1` и задает заголовок документа. `Section` висит на дорожке платы: узел у заголовка и линия вдоль раздела.
- `Button`, `ButtonLink` (варианты `primary`, `secondary`, `quiet`), `TextLink`, `NavItem` - элементы управления с текстовыми подписями; `NavItem` отмечает активный раздел через `aria-current` и инверсией капсулы.
- `HeaderPlate`, `MenuButton`, `useMenuToggle`, `Wordmark` - шапка оболочек: плавающая стеклянная плашка, кнопка меню с `aria-expanded` (меню закрывается после перехода и по Escape, фокус возвращается на кнопку) и словесный знак.
- `Card` (`raised`, `inset`, `panel`), `Tag` (`neutral`, `grade`, `stack`, `accent`, `success`, `danger`), `AttentionDot`, `Notice` - контейнеры, метки и сообщения. Смысл всегда передан текстом, цвет его только повторяет.
- `Stepper` и `buildSteps` - ход многошагового сценария: строка "Шаг N из M", список с `aria-current="step"` и текстовым статусом каждого шага.
- `Tabs` (шаблон вкладок WAI-ARIA, стрелки, Home и End, неактивные панели остаются в дереве со скрытым атрибутом, поэтому состояние формы сохраняется) и `SegmentedControl` (нативная группа радиокнопок в виде капсул).
- `StatusView`, `LoadingState`, `EmptyState`, `ErrorState`, `ForbiddenState`, `SavingStatus` - состояния экранов. У каждого состояния своя форма и текст; пустое состояние рисует дорожку платы, которая заканчивается пустым узлом. `ErrorState` показывает код, статус, текст сервера и идентификатор запроса как обычный текст и предлагает повтор. `Skeleton` - декоративные заготовки строк при загрузке, только вместе с сообщением о загрузке.
- `QueryView` - превращает результат запроса в загрузку, ошибку, отсутствие доступа (401 и 403 без повтора), пустое состояние или данные.
- `TrustLevel` - пустая метка, кольцо, частичная или полная заливка с видимой подписью.
- `Mono`, `VisuallyHidden`, `SkipLink`, `MainRegion`, `BrandLogo`.
- `CircuitTrace`, `Mono`, `VisuallyHidden`, `SkipLink`, `MainRegion`.
Доступность: каждая оболочка начинается со ссылки пропуска к `main`, содержит ориентиры и видимое кольцо фокуса и переводит фокус на `main` после перехода. Анимации учитывают `prefers-reduced-motion`.
Оболочки. Публичная: плавающая плашка со словесным знаком и ссылками, ниже 700px ссылки открываются кнопкой "Меню"; подвал со ссылкой на технический статус. Кандидат (сначала телефон): ниже 700px разделы образуют нижнюю панель вкладок с прокруткой, текущая вкладка прокручивается в середину; с 700px вкладки стоят в плашке. Навигация в документе идет до `main`, поэтому порядок клавиатуры одинаков на любой ширине. Работодатель (сначала компьютер): с 1024px плавающая боковая панель 240px, ниже - плашка с кнопкой "Меню".
Доступность: каждая оболочка начинается со ссылки пропуска к `main`, содержит ориентиры и видимое кольцо фокуса (2px `#9A92FF` с отступом 2px) и переводит фокус на `main` после перехода. Анимации учитывают `prefers-reduced-motion`.
## Тесты
+4 -2
View File
@@ -2,8 +2,10 @@
<html lang="ru">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#ededed" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<meta name="color-scheme" content="dark" />
<meta name="theme-color" content="#1b1c21" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<title>Lincodex</title>
</head>
<body>
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><rect width="64" height="64" rx="16" fill="#402FFF"/><path fill="#FFF" d="M16 13h10v29h18v9H16z"/><rect x="47" y="13" width="5" height="38" rx="1" fill="#EDEDED"/></svg>

After

Width:  |  Height:  |  Size: 230 B

+125 -6
View File
@@ -3,13 +3,18 @@
color: var(--color-text);
font-family: var(--font-text);
font-size: 100%;
font-feature-settings:
"cv11" 1,
"ss01" 0;
line-height: var(--line-height-body);
background-color: var(--color-canvas);
color-scheme: light;
color-scheme: dark;
font-synthesis: none;
text-rendering: optimizelegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
accent-color: var(--color-action);
scrollbar-color: var(--color-border-hover) transparent;
}
*,
@@ -18,15 +23,31 @@
box-sizing: border-box;
}
/* Sticky and fixed chrome must not hide the target of an in-page jump or of
* a programmatic scroll into view. */
html {
scroll-padding-block: calc(var(--header-height) + var(--chrome-inset) * 2 + var(--space-2))
var(--space-4);
}
/* The candidate cabinet has a bottom tab bar on phones. */
@media (width < 43.75rem) {
html {
scroll-padding-bottom: 5rem;
}
}
body {
min-width: 20rem;
min-height: 100vh;
margin: 0;
font-size: var(--font-size-m);
background-color: var(--color-canvas);
}
/* Sparse dot grid: a quiet "protocol paper" texture behind surfaces. */
background-image: radial-gradient(circle at 1px 1px, rgb(27 28 33 / 9%) 1px, transparent 1.5px);
background-size: 1.5rem 1.5rem;
::selection {
color: var(--color-on-accent);
background: var(--color-accent);
}
h1,
@@ -42,14 +63,30 @@ figure {
margin: 0;
}
/* Headings speak in JetBrains Mono, the voice of the product. Paragraphs,
* meta, and form text stay in Inter: long mono text tires the eye. */
h1,
h2,
h3,
h4 {
font-family: var(--font-mono);
font-weight: var(--font-weight-medium);
letter-spacing: -0.01em;
line-height: var(--line-height-snug);
text-wrap: balance;
}
strong,
b {
font-weight: var(--font-weight-bold);
}
code,
kbd,
samp {
font-family: var(--font-mono);
}
button,
input,
select,
@@ -64,8 +101,90 @@ svg {
max-width: 100%;
}
/* One focus indicator for every interactive element. Local dark regions
* override --color-focus-ring with a checked value. */
hr {
height: 0;
margin: 0;
border: 0;
border-top: var(--line-thin) solid var(--color-divider);
}
/*
* Native form controls. Screens style their fields with module classes; these
* element rules give every field the same dark capsule and padding. The html
* prefix and the :not() list give them the specificity (0,1,2): above a
* module rule such as ".field input" or ".input", below a state rule such as
* ".field input[aria-invalid]" or ".input:focus-visible". Borders stay with
* the modules, which use --color-border-strong and the danger color.
*/
html :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"]), select) {
min-height: var(--control-height);
padding-inline: var(--space-4);
border-radius: var(--radius-pill);
color: var(--color-text);
background-color: var(--color-surface);
}
html textarea:not([hidden]) {
padding: var(--space-3) var(--space-4);
border-radius: var(--radius-s);
color: var(--color-text);
background-color: var(--color-surface);
}
/* A drawn chevron replaces the light native arrow. */
html select:not([multiple]) {
max-width: 100%;
padding-inline-end: var(--space-7);
appearance: none;
background-image:
linear-gradient(45deg, transparent 50%, var(--color-text-secondary) 50%),
linear-gradient(135deg, var(--color-text-secondary) 50%, transparent 50%);
background-position:
right 1.35rem center,
right 1rem center;
background-repeat: no-repeat;
background-size:
0.35rem 0.35rem,
0.35rem 0.35rem;
}
select option {
color: var(--color-text);
background-color: var(--color-surface-elevated);
}
:is(input, textarea)::placeholder {
color: var(--color-text-muted);
opacity: 1;
}
:is(input, select, textarea):hover:not([readonly], :disabled, :focus, [aria-invalid="true"]) {
border-color: var(--color-text-secondary);
}
input[type="checkbox"],
input[type="radio"] {
width: 1.125rem;
height: 1.125rem;
flex: none;
accent-color: var(--color-action);
}
/* A read-only field during a pending request stays readable but quiet. */
:is(input, textarea)[readonly] {
color: var(--color-text-secondary);
}
:is(input, select, textarea, button):disabled {
cursor: not-allowed;
opacity: 0.55;
}
details > summary {
cursor: pointer;
}
/* One focus indicator for every interactive element. */
:focus-visible {
outline: var(--focus-ring-width) solid var(--color-focus-ring);
outline-offset: var(--focus-ring-offset);
@@ -83,7 +83,7 @@
width: 1.25rem;
height: 1.25rem;
margin: 0.2rem 0 0;
accent-color: var(--color-accent);
accent-color: var(--color-action);
}
.option span {
@@ -46,7 +46,7 @@
width: 1.2rem;
height: 1.2rem;
margin-block-start: 0.15rem;
accent-color: var(--color-accent);
accent-color: var(--color-action);
}
.field {
@@ -107,7 +107,7 @@
width: 1.15rem;
height: 1.15rem;
margin-top: 0.2em;
accent-color: var(--color-accent);
accent-color: var(--color-action);
}
.grant-actions {
@@ -79,7 +79,7 @@
width: 1.25rem;
height: 1.25rem;
margin: 0;
accent-color: var(--color-accent);
accent-color: var(--color-action);
}
.quota {
@@ -6,6 +6,7 @@
.selector {
display: grid;
grid-template-columns: minmax(0, 1fr);
gap: var(--space-2);
max-width: 24rem;
}
@@ -33,7 +33,7 @@
width: 1.15rem;
height: 1.15rem;
margin-top: 0.2em;
accent-color: var(--color-accent);
accent-color: var(--color-action);
}
.choice input:focus-visible {
@@ -67,7 +67,7 @@
width: 1.1rem;
height: 1.1rem;
margin-top: 0.2rem;
accent-color: var(--color-accent);
accent-color: var(--color-action);
}
.choice-body {
@@ -111,7 +111,7 @@
width: 1.1rem;
height: 1.1rem;
margin-top: 0.2rem;
accent-color: var(--color-accent);
accent-color: var(--color-action);
}
.actions {
@@ -56,7 +56,7 @@
width: 1.25rem;
height: 1.25rem;
margin: 0.2rem 0 0;
accent-color: var(--color-accent);
accent-color: var(--color-action);
}
.option span {
@@ -0,0 +1,21 @@
/* Auth forms sit on a raised panel: the one surface of the page, so the eye
* goes to the fields. */
.panel {
display: grid;
gap: var(--space-6);
padding: var(--space-5) var(--space-4);
border: var(--line-thin) solid var(--color-divider);
border-radius: var(--radius-l);
background: var(--color-surface);
}
.aside {
color: var(--color-text-secondary);
font-size: var(--font-size-s);
}
@media (width >= 43.75rem) {
.panel {
padding: var(--space-6);
}
}
+10 -7
View File
@@ -2,6 +2,7 @@ import { useCallback, useState } from "react";
import { ResendVerificationForm } from "../../../features/resend-email-verification";
import { SignInForm } from "../../../features/sign-in";
import { Page, Section } from "../../../shared/ui";
import styles from "./auth.module.css";
import { clearRegistrationContext } from "../model/registration-context";
export function LoginPage() {
@@ -13,14 +14,16 @@ export function LoginPage() {
return (
<Page title="Вход" lead="Войдите, чтобы продолжить настройку аккаунта с сохраненного шага.">
<Section title="Войти в аккаунт">
<SignInForm onUnverified={setUnverifiedEmail} onSignedIn={clearPendingRegistration} />
</Section>
{unverifiedEmail ? (
<Section title="Повторная отправка письма">
<ResendVerificationForm initialEmail={unverifiedEmail} />
<div className={styles.panel}>
<Section title="Войти в аккаунт">
<SignInForm onUnverified={setUnverifiedEmail} onSignedIn={clearPendingRegistration} />
</Section>
) : null}
{unverifiedEmail ? (
<Section title="Повторная отправка письма">
<ResendVerificationForm initialEmail={unverifiedEmail} />
</Section>
) : null}
</div>
</Page>
);
}
+24 -10
View File
@@ -1,7 +1,7 @@
import { useState } from "react";
import { RegisterForm, type RegistrationDraft } from "../../../features/register-account";
import { VerificationCodeForm } from "../../../features/verify-email-code";
import { Button, Page, Section, TextLink } from "../../../shared/ui";
import { Button, Page, Section, Stepper, TextLink, buildSteps } from "../../../shared/ui";
import { paths } from "../../../shared/config";
import {
clearRegistrationContext,
@@ -9,6 +9,13 @@ import {
writeRegistrationContext,
type RegistrationContext,
} from "../model/registration-context";
import styles from "./auth.module.css";
const registrationSteps = [
{ id: "account", label: "Данные аккаунта" },
{ id: "code", label: "Код из письма" },
{ id: "sign-in", label: "Вход в кабинет" },
] as const;
function scenarioLabel(scenario: RegistrationDraft["scenario"]): string {
return scenario === "employer" ? "работодатель" : "кандидат";
@@ -21,6 +28,8 @@ export function RegisterPage() {
// for it again.
const [registrationPassword, setRegistrationPassword] = useState<string | undefined>();
const [messageJustSent, setMessageJustSent] = useState(false);
const [confirmed, setConfirmed] = useState(false);
const stepIndex = confirmed ? 2 : context.accepted ? 1 : 0;
function saveDraft(draft: RegistrationDraft) {
const next = { ...draft, accepted: false };
@@ -37,6 +46,7 @@ export function RegisterPage() {
}
function finishConfirmation() {
setConfirmed(true);
setRegistrationPassword(undefined);
setMessageJustSent(false);
clearRegistrationContext();
@@ -47,6 +57,7 @@ export function RegisterPage() {
setContext({ email: "", scenario: "", accepted: false });
setRegistrationPassword(undefined);
setMessageJustSent(false);
setConfirmed(false);
}
return (
@@ -54,8 +65,9 @@ export function RegisterPage() {
title="Регистрация"
lead="Создайте аккаунт и выберите, как вы будете пользоваться платформой."
>
<Stepper label="Шаги регистрации" steps={buildSteps(registrationSteps, stepIndex)} />
{context.accepted ? (
<div>
<div className={styles.panel}>
<Section title="Запрос принят">
<p role="status" aria-live="polite">
Если адрес можно зарегистрировать, письмо с кодом и ссылкой придет на него. Выбранный
@@ -76,14 +88,16 @@ export function RegisterPage() {
</Section>
</div>
) : (
<Section title="Данные аккаунта">
<RegisterForm
initialEmail={context.email}
initialScenario={context.scenario}
onDraftChange={saveDraft}
onAccepted={markAccepted}
/>
</Section>
<div className={styles.panel}>
<Section title="Данные аккаунта">
<RegisterForm
initialEmail={context.email}
initialScenario={context.scenario}
onDraftChange={saveDraft}
onAccepted={markAccepted}
/>
</Section>
</div>
)}
</Page>
);
@@ -2,6 +2,7 @@ import { useCallback, useState } from "react";
import { ConfirmEmailForm } from "../../../features/confirm-email";
import { VerificationCodeForm } from "../../../features/verify-email-code";
import { Page, Section } from "../../../shared/ui";
import styles from "./auth.module.css";
import { clearRegistrationContext } from "../model/registration-context";
export function VerifyEmailPage() {
@@ -18,18 +19,20 @@ export function VerifyEmailPage() {
title="Подтверждение почты"
lead="Подтвердите адрес ссылкой из письма или кодом из письма и паролем регистрации."
>
<Section title="Подтвердить адрес">
<ConfirmEmailForm
onResendNeeded={requestCode}
onTokenReady={linkReady}
onConfirmed={finishConfirmation}
/>
</Section>
{needsCode ? (
<Section title="Введите код из письма">
<VerificationCodeForm onConfirmed={clearRegistrationContext} />
<div className={styles.panel}>
<Section title="Подтвердить адрес">
<ConfirmEmailForm
onResendNeeded={requestCode}
onTokenReady={linkReady}
onConfirmed={finishConfirmation}
/>
</Section>
) : null}
{needsCode ? (
<Section title="Введите код из письма">
<VerificationCodeForm onConfirmed={clearRegistrationContext} />
</Section>
) : null}
</div>
</Page>
);
}
@@ -69,7 +69,7 @@
width: 1.25rem;
height: 1.25rem;
margin: 0;
accent-color: var(--color-accent);
accent-color: var(--color-action);
}
.hint {
@@ -0,0 +1,183 @@
.root {
position: relative;
display: grid;
gap: var(--space-5);
margin: 0;
padding: var(--space-5);
border: var(--line-thin) solid var(--color-divider);
border-radius: var(--radius-l);
background: var(--color-surface);
}
.caption {
display: flex;
gap: var(--space-3);
align-items: center;
justify-content: space-between;
color: var(--color-text-secondary);
font-family: var(--font-mono);
font-size: var(--font-size-xs);
font-weight: var(--font-weight-medium);
letter-spacing: var(--letter-spacing-label);
text-transform: uppercase;
}
/* A dashed capsule says the values are an illustration. */
.example {
padding: 0.125rem 0.625rem;
border: var(--line-thin) dashed var(--color-border-strong);
border-radius: var(--radius-pill);
letter-spacing: 0.02em;
text-transform: none;
}
/* The trace: a hairline from the first node to the last, with a signal in
* the readable accent that runs down it once. */
.steps {
--node-x: 0.4375rem;
--signal: 1.6s;
position: relative;
display: grid;
gap: var(--space-5);
margin: 0;
padding: 0;
list-style: none;
}
.steps::before,
.steps::after {
position: absolute;
top: 0.5rem;
bottom: 0.5rem;
left: calc(var(--node-x) + 0.25rem - 0.75px);
width: 1.5px;
border-radius: 1px;
content: "";
}
.steps::before {
background: var(--color-trace);
opacity: 0.6;
}
.steps::after {
background: var(--color-accent);
transform-origin: top;
animation: signal var(--signal) var(--easing-emphasized) 300ms both;
}
.step {
position: relative;
display: grid;
gap: var(--space-1);
padding-left: var(--space-6);
}
/* An 8px node lights up when the signal reaches it. */
.node {
position: absolute;
z-index: 1;
top: 0.3rem;
left: var(--node-x);
width: 0.5rem;
height: 0.5rem;
border-radius: 50%;
background: var(--color-accent);
box-shadow: 0 0 0 3px var(--color-surface);
animation: light 300ms var(--easing-standard) both;
}
.step:nth-child(1) .node {
animation-delay: 300ms;
}
.step:nth-child(2) .node {
animation-delay: 750ms;
}
.step:nth-child(3) .node {
animation-delay: 1200ms;
}
.step:nth-child(4) .node {
animation-delay: 1650ms;
}
.kicker {
color: var(--color-text-secondary);
font-family: var(--font-mono);
font-size: var(--font-size-xs);
font-weight: var(--font-weight-medium);
letter-spacing: var(--letter-spacing-label);
line-height: 1.4;
text-transform: uppercase;
}
.text {
color: var(--color-text);
font-size: var(--font-size-s);
line-height: 1.5;
}
.artifact {
display: flex;
flex-wrap: wrap;
gap: var(--space-2);
align-items: baseline;
padding-top: var(--space-2);
}
.query {
padding: var(--space-1) var(--space-3);
border-radius: var(--radius-pill);
color: var(--color-accent);
font-size: 0.75rem;
font-variant-ligatures: none;
background: var(--color-canvas);
}
.salary {
color: var(--color-text-strong);
font-family: var(--font-mono);
font-size: 1.125rem;
font-variant-numeric: tabular-nums;
font-weight: var(--font-weight-bold);
}
.basis {
color: var(--color-text-secondary);
font-size: var(--font-size-xs);
}
@media (width >= 48rem) {
.root {
padding: var(--space-6);
}
}
@keyframes signal {
from {
transform: scaleY(0);
}
to {
transform: scaleY(1);
}
}
@keyframes light {
from {
background: var(--color-surface);
box-shadow:
0 0 0 3px var(--color-surface),
inset 0 0 0 1.5px var(--color-trace);
}
}
@media (prefers-reduced-motion: reduce) {
.steps::after,
.node {
animation: none;
}
}
@@ -0,0 +1,63 @@
import { useId } from "react";
import { Tag } from "../../../shared/ui";
import styles from "./protocol-trace.module.css";
/**
* The matching protocol as one circuit trace: test, search, invitation,
* contacts. The values are a labeled example, not data from the service.
* The trace draws itself and the nodes light up in order once; reduced
* motion shows the finished state.
*/
export function ProtocolTrace() {
const captionId = useId();
return (
<figure className={styles.root} aria-labelledby={captionId}>
<figcaption id={captionId} className={styles.caption}>
<span>Как проходит подбор</span>
<span className={styles.example}>пример</span>
</figcaption>
<ol className={styles.steps}>
<li className={styles.step}>
<span className={styles.node} aria-hidden="true" />
<p className={styles.kicker}>Тест</p>
<p className={styles.text}>Кандидат проходит проверку по своей специализации.</p>
<p className={styles.artifact}>
<Tag tone="grade">Backend · Middle</Tag>
<Tag tone="success" dot>
Грейд подтвержден
</Tag>
</p>
</li>
<li className={styles.step}>
<span className={styles.node} aria-hidden="true" />
<p className={styles.kicker}>Поиск</p>
<p className={styles.text}>
Компания ищет по подтвержденной категории и видит заявленный уровень отдельно.
</p>
<p className={styles.artifact}>
<code className={styles.query}>backend · middle · подтвержден</code>
</p>
</li>
<li className={styles.step}>
<span className={styles.node} aria-hidden="true" />
<p className={styles.kicker}>Приглашение</p>
<p className={styles.text}>Условия и вилка зарплаты видны до ответа.</p>
<p className={styles.artifact}>
<span className={styles.salary}>180 000 – 240 000 ₽</span>
<span className={styles.basis}>на руки</span>
</p>
</li>
<li className={styles.step}>
<span className={styles.node} aria-hidden="true" />
<p className={styles.kicker}>Контакты</p>
<p className={styles.text}>Кандидат сам выбирает, какие контакты открыть компании.</p>
<p className={styles.artifact}>
<Tag tone="accent">Почта: открыта</Tag>
<Tag>Телефон: скрыт</Tag>
</p>
</li>
</ol>
</figure>
);
}
@@ -1,3 +1,127 @@
.page {
display: grid;
gap: var(--space-8);
width: 100%;
max-width: calc(var(--content-width-wide) + 2 * var(--gutter));
margin-inline: auto;
padding: var(--space-7) var(--gutter) var(--space-6);
}
/* Hero: the thesis, then the protocol trace; side by side on desktop. */
.hero {
display: grid;
gap: var(--space-7);
align-items: start;
}
.thesis {
display: grid;
gap: var(--space-5);
align-content: start;
min-width: 0;
}
/* System-status line: a green dot because these flows work today. */
.status {
display: inline-flex;
gap: var(--space-2);
align-items: baseline;
color: var(--color-text-secondary);
font-family: var(--font-mono);
font-size: var(--font-size-xs);
font-weight: var(--font-weight-medium);
line-height: 1.5;
}
.status-dot {
flex: none;
width: 0.5rem;
height: 0.5rem;
border-radius: 50%;
background: var(--color-success);
transform: translateY(-0.05rem);
}
.title {
max-width: 17ch;
color: var(--color-text-strong);
font-size: var(--font-size-display);
font-weight: var(--font-weight-medium);
letter-spacing: -0.04em;
line-height: 1.06;
overflow-wrap: anywhere;
hyphens: manual;
}
.lead {
max-width: 36rem;
color: var(--color-text);
font-size: 1.125rem;
line-height: 1.55;
}
.note {
max-width: 36rem;
color: var(--color-text-secondary);
font-size: var(--font-size-s);
}
.actions {
display: flex;
flex-wrap: wrap;
gap: var(--space-3);
padding-top: var(--space-1);
}
.help {
max-width: 36rem;
color: var(--color-text-secondary);
font-size: var(--font-size-s);
}
/* Jury block of the demonstration stand: a panel marked with the red
* "live" dot of the design system. */
.jury {
display: grid;
gap: var(--space-3);
justify-items: start;
padding: var(--space-5);
border: var(--line-thin) solid var(--color-divider);
border-radius: var(--radius-m);
background: var(--color-surface);
}
.jury-title {
display: inline-flex;
gap: var(--space-2);
align-items: center;
color: var(--color-text-strong);
font-size: var(--font-size-l);
}
.jury-title::before {
width: 0.5rem;
height: 0.5rem;
border-radius: 50%;
content: "";
background: var(--color-attention);
}
.jury-text {
max-width: 44rem;
color: var(--color-text-secondary);
}
.block {
display: grid;
gap: var(--space-5);
}
.block-title {
color: var(--color-text-strong);
font-size: var(--font-size-xl);
}
.cabinets {
display: grid;
gap: var(--space-4);
@@ -7,67 +131,34 @@
}
.card {
position: relative;
display: grid;
gap: var(--space-2);
grid-template-rows: auto auto auto 1fr auto;
gap: var(--space-3);
justify-items: start;
padding: var(--space-5);
border: var(--line-thin) solid var(--color-border-strong);
border-radius: var(--radius-l);
color: var(--color-text);
text-decoration: none;
border: var(--line-thin) solid var(--color-divider);
border-radius: var(--radius-m);
background: var(--color-surface);
transition:
border-color var(--duration-fast) var(--easing-standard),
transform var(--duration-base) var(--easing-standard);
}
/* Connector node in the corner, echoing the brand line graphics. */
.card::after {
position: absolute;
top: var(--space-5);
right: var(--space-5);
width: 0.75rem;
height: 0.75rem;
border: var(--line-strong) solid var(--color-accent);
border-radius: 50%;
content: "";
transition: background-color var(--duration-fast) var(--easing-standard);
transition: border-color var(--duration-fast) var(--easing-standard);
}
.card:hover {
border-color: var(--color-accent);
transform: translateY(-2px);
}
.card:hover::after {
background: var(--color-accent);
}
.format {
color: var(--color-accent);
font-size: var(--font-size-xs);
font-weight: var(--font-weight-bold);
letter-spacing: var(--letter-spacing-label);
text-transform: uppercase;
border-color: var(--color-border-hover);
}
.card-title {
font-size: var(--font-size-xl);
font-weight: var(--font-weight-bold);
line-height: var(--line-height-snug);
text-decoration: underline;
text-decoration-thickness: var(--line-thin);
text-underline-offset: 0.2em;
color: var(--color-text-strong);
font-size: var(--font-size-l);
}
.summary {
color: var(--color-text-secondary);
color: var(--color-text);
}
.features {
display: grid;
gap: var(--space-1);
margin: var(--space-2) 0 0;
gap: var(--space-2);
margin: 0;
padding: 0;
color: var(--color-text-secondary);
font-size: var(--font-size-s);
@@ -76,33 +167,56 @@
.features li {
position: relative;
padding-left: var(--space-3);
padding-left: var(--space-5);
}
/* Short accent rule in place of bullets, matching the corner connector. */
/* A short trace with a node in place of a bullet. */
.features li::before {
position: absolute;
top: 0.7em;
top: 0.72em;
left: 0;
width: 0.5rem;
width: 0.875rem;
height: var(--line-thin);
background: var(--color-accent);
content: "";
background: var(--color-trace);
}
.actions {
display: flex;
flex-wrap: wrap;
gap: var(--space-2);
.features li::after {
position: absolute;
top: calc(0.72em - 0.1875rem);
left: 0.875rem;
width: 0.375rem;
height: 0.375rem;
border-radius: 50%;
content: "";
background: var(--color-accent);
}
.help {
color: var(--color-text-secondary);
.card-action {
padding-top: var(--space-2);
font-family: var(--font-mono);
font-size: var(--font-size-s);
}
.pending {
max-width: 44rem;
color: var(--color-text-secondary);
}
@media (width >= 48rem) {
.cabinets {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
@media (width >= 64rem) {
.page {
gap: var(--space-9);
padding-top: var(--space-8);
}
.hero {
grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
gap: var(--space-8);
}
}
+88 -45
View File
@@ -1,12 +1,16 @@
import { Link } from "react-router-dom";
import { useId } from "react";
import { paths } from "../../../shared/config";
import { ButtonLink, Page, Section, TextLink } from "../../../shared/ui";
import { ButtonLink, Tag, TextLink } from "../../../shared/ui";
import { ProtocolTrace } from "./protocol-trace";
import styles from "./welcome-page.module.css";
const title = "Протокол подтвержденных навыков";
const cabinets = [
{
to: paths.candidate.root,
title: "Кабинет кандидата",
action: "Открыть кабинет кандидата",
format: "Для телефона",
summary: "Профиль и анкета, тест на подтверждение уровня, результаты и настройки видимости.",
features: [
@@ -19,6 +23,7 @@ const cabinets = [
{
to: paths.employer.root,
title: "Кабинет работодателя",
action: "Открыть кабинет работодателя",
format: "Для компьютера",
summary:
"Компания и статус ее проверки, потребности, поиск кандидатов и составление приглашений.",
@@ -32,65 +37,103 @@ const cabinets = [
] as const;
/**
* Public start page. It describes the cabinets that work now and names the
* screens that are still placeholders, so the page makes no promise the
* product does not keep. A demonstration stand adds the link to the jury guide.
* Public start page. The hero states the product's thesis and shows the
* matching protocol as an example; the cabinets section lists what works now,
* and the page names the screen that is still a placeholder, so it makes no
* promise the product does not keep. A demonstration stand adds the link to
* the jury guide.
*/
export function WelcomePage({ demoStand = false }: { demoStand?: boolean }) {
const titleId = useId();
const juryId = useId();
const cabinetsId = useId();
const pendingId = useId();
return (
<Page
title="Протокол подтвержденных навыков"
eyebrow="Lincodex"
lead="Регистрация, вход и основные сценарии кабинетов уже работают. Заявленный уровень остается самооценкой: подтвержденную категорию присваивает только результат теста."
>
<div className={styles.page}>
<title>{`${title} - Lincodex`}</title>
<section className={styles.hero} aria-labelledby={titleId}>
<div className={styles.thesis}>
<p className={styles.status}>
<span className={styles["status-dot"]} aria-hidden="true" />
Регистрация, вход и основные сценарии кабинетов уже работают.
</p>
<h1 id={titleId} className={styles.title}>
{title}
</h1>
<p className={styles.lead}>
Кандидат подтверждает уровень тестом. Компания находит его по подтвержденной категории и
приглашает с вилкой зарплаты. Контакты открываются, только если кандидат согласился.
</p>
<p className={styles.note}>
Заявленный уровень остается самооценкой: подтвержденную категорию присваивает только
результат теста.
</p>
<div className={styles.actions}>
<ButtonLink to={paths.register}>Зарегистрироваться</ButtonLink>
<ButtonLink to={paths.login} variant="secondary">
Войти
</ButtonLink>
</div>
<p className={styles.help}>
Подтверждение почты и повторная отправка письма находятся на странице{" "}
<TextLink to={paths.verifyEmail}>подтверждения почты</TextLink>. Вопросы о работе
сервиса задайте в <TextLink to={paths.support}>поддержке</TextLink>.
</p>
</div>
<ProtocolTrace />
</section>
{demoStand ? (
<Section title="Для жюри">
<p>
<section className={styles.jury} aria-labelledby={juryId}>
<h2 id={juryId} className={styles["jury-title"]}>
Для жюри
</h2>
<p className={styles["jury-text"]}>
Этот стенд показывает продукт на синтетических данных. Гид описывает маршрут на восемь
минут двумя ролями и отделяет имитации от работающего функционала.
</p>
<div className={styles.actions}>
<ButtonLink to={paths.demoGuide}>Открыть гид для жюри</ButtonLink>
<div>
<ButtonLink to={paths.demoGuide} variant="secondary">
Открыть гид для жюри
</ButtonLink>
</div>
</Section>
</section>
) : null}
<Section title="Кабинеты">
<section className={styles.block} aria-labelledby={cabinetsId}>
<h2 id={cabinetsId} className={styles["block-title"]}>
Кабинеты
</h2>
<ul className={styles.cabinets}>
{cabinets.map((cabinet) => (
<li key={cabinet.to}>
<Link className={styles.card} to={cabinet.to}>
<span className={styles.format}>{cabinet.format}</span>
<span className={styles["card-title"]}>{cabinet.title}</span>
<span className={styles.summary}>{cabinet.summary}</span>
<ul className={styles.features}>
{cabinet.features.map((feature) => (
<li key={feature}>{feature}</li>
))}
</ul>
</Link>
<li key={cabinet.to} className={styles.card}>
<Tag>{cabinet.format}</Tag>
<h3 className={styles["card-title"]}>{cabinet.title}</h3>
<p className={styles.summary}>{cabinet.summary}</p>
<ul className={styles.features}>
{cabinet.features.map((feature) => (
<li key={feature}>{feature}</li>
))}
</ul>
<div className={styles["card-action"]}>
<TextLink to={cabinet.to}>{cabinet.action}</TextLink>
</div>
</li>
))}
</ul>
</Section>
<Section title="Пока не готово">
<p>
</section>
<section className={styles.block} aria-labelledby={pendingId}>
<h2 id={pendingId} className={styles["block-title"]}>
Пока не готово
</h2>
<p className={styles.pending}>
Список приглашений, отправленных компанией, пока заготовка: этот экран не показывает
данных и не выполняет действий.
</p>
</Section>
<Section title="Вход и регистрация">
<div className={styles.actions}>
<ButtonLink to={paths.login}>Войти</ButtonLink>
<ButtonLink to={paths.register} variant="secondary">
Зарегистрироваться
</ButtonLink>
</div>
<p className={styles.help}>
Подтверждение почты и повторная отправка письма находятся на странице{" "}
<TextLink to={paths.verifyEmail}>подтверждения почты</TextLink>. Вопросы о работе сервиса
задайте в <TextLink to={paths.support}>поддержке</TextLink>.
</p>
</Section>
</Page>
</section>
</div>
);
}
@@ -1,45 +0,0 @@
.root {
display: inline-flex;
gap: var(--space-3);
align-items: center;
min-height: 2.75rem;
border-radius: var(--radius-s);
text-decoration: none;
}
.logo {
width: auto;
height: 1.75rem;
}
.divider {
align-self: stretch;
width: var(--line-thin);
margin-block: var(--space-2);
background: currentcolor;
opacity: 0.4;
}
.name {
display: grid;
font-size: var(--font-size-m);
font-weight: var(--font-weight-bold);
letter-spacing: -0.01em;
line-height: 1.1;
}
.context {
font-size: var(--font-size-xs);
font-weight: var(--font-weight-medium);
letter-spacing: 0;
}
/* Graphite on white 17.01:1. */
.light {
color: var(--color-text);
}
/* Light grey on graphite 14.53:1. */
.dark {
color: var(--palette-light);
}
@@ -1,36 +0,0 @@
import { Link } from "react-router-dom";
import logoOnDark from "./fsp-logo-on-dark.svg";
import logoOnLight from "./fsp-logo-on-light.svg";
import styles from "./brand-logo.module.css";
type BrandLogoProps = {
/** Background the logo sits on; selects the brandbook color variant. */
tone?: "light" | "dark";
/** Destination of the home link. */
to?: string;
/** Cabinet name shown after the product name. */
context?: string | undefined;
};
/**
* Brandbook FSP logo (logo_02w for light, logo_01 for dark backgrounds)
* followed by the product name. The whole block is one link home.
*/
export function BrandLogo({ tone = "light", to = "/", context }: BrandLogoProps) {
return (
<Link to={to} className={`${styles.root} ${styles[tone]}`}>
<img
className={styles.logo}
src={tone === "dark" ? logoOnDark : logoOnLight}
alt="ФСП"
width="345"
height="116"
/>
<span className={styles.divider} aria-hidden="true" />
<span className={styles.name}>
Lincodex
{context ? <span className={styles.context}>{context}</span> : null}
</span>
</Link>
);
}
@@ -1,12 +0,0 @@
<svg width="345.000000" height="117.000000" viewBox="0 0 345 117" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<desc>
Created with Pixso.
</desc>
<defs/>
<path id="Vector" d="M36.42 96.37C35.54 95.73 34.88 94.83 34.54 93.79C34.2 92.76 34.2 91.64 34.53 90.61L35.61 86.15C35.81 85.36 36.16 84.63 36.66 83.99C37.15 83.35 37.78 82.82 38.49 82.44L42.03 80.58C44.22 79.45 45.97 77.62 47 75.38C48.02 73.15 48.28 70.63 47.72 68.24L47.67 68.01C47.01 65.33 45.38 62.99 43.08 61.45C40.79 59.9 38 59.27 35.27 59.67L31.3 60.24C30.5 60.35 29.68 60.3 28.89 60.07C28.11 59.85 27.39 59.46 26.76 58.94L23.26 55.97C22.39 55.32 21.75 54.41 21.41 53.38C21.08 52.35 21.08 51.24 21.41 50.21C22.15 47.92 22.13 45.45 21.34 43.17C20.56 40.89 19.05 38.93 17.05 37.59C15.05 36.24 12.67 35.58 10.26 35.71C7.85 35.84 5.55 36.74 3.71 38.29C1.86 39.84 0.57 41.95 0.03 44.3C-0.51 46.64 -0.27 49.1 0.72 51.3C1.7 53.5 3.37 55.32 5.48 56.48C7.59 57.65 10.03 58.09 12.41 57.75C12.8 57.7 13.18 57.61 13.56 57.52L14.59 57.32C15.45 57.16 16.33 57.18 17.17 57.4C18.02 57.62 18.8 58.03 19.46 58.6L24.22 62.72C24.95 63.35 25.51 64.16 25.84 65.07C26.17 65.98 26.27 66.95 26.13 67.91L26.01 68.63L25.91 69.27L25.91 69.32C25.76 70.64 25.84 71.98 26.16 73.27C26.16 73.35 26.16 73.42 26.22 73.49L26.22 73.57C26.67 75.32 27.56 76.93 28.79 78.26C28.94 78.42 29.09 78.57 29.24 78.71L29.76 79.23C30.45 79.93 30.95 80.78 31.21 81.72C31.47 82.66 31.5 83.65 31.27 84.6L29.82 90.7C29.62 91.54 29.23 92.33 28.68 93.01C28.12 93.68 27.42 94.22 26.63 94.58L25.74 94.99C25.38 95.13 25.02 95.3 24.68 95.48C23.06 96.33 21.67 97.58 20.66 99.1C18.97 101.51 18.32 104.49 18.83 107.38C19.35 110.27 21 112.84 23.41 114.52C25.82 116.2 28.8 116.86 31.7 116.34C34.6 115.83 37.17 114.18 38.85 111.77C39.85 110.41 40.52 108.84 40.81 107.17C40.88 106.8 40.93 106.42 40.96 106.04L41.08 105.07C41.01 103.36 40.56 101.69 39.75 100.18C38.94 98.67 37.81 97.37 36.42 96.37Z" fill="#EDEDED" fill-opacity="1.000000" fill-rule="nonzero"/>
<path id="Vector" d="M121.18 43.37C120.59 41.59 119.56 39.98 118.18 38.7C116.81 37.42 115.12 36.51 113.3 36.05C111.47 35.6 109.56 35.62 107.74 36.1C105.92 36.59 104.26 37.53 102.9 38.83C102.61 39.09 102.34 39.37 102.08 39.66L101.41 40.38C100.82 41.02 100.09 41.52 99.28 41.83C98.47 42.15 97.6 42.28 96.73 42.21L90.47 41.7C89.5 41.62 88.56 41.3 87.75 40.76C86.93 40.22 86.27 39.48 85.82 38.61L85.49 37.96C85.39 37.76 85.3 37.57 85.19 37.39L85.19 37.33C84.54 36.17 83.69 35.14 82.66 34.28L82.5 34.15L82.42 34.08C81.02 32.94 79.36 32.16 77.59 31.8L77.52 31.8L76.89 31.7L76.15 31.64C75.19 31.48 74.28 31.08 73.52 30.48C72.75 29.88 72.15 29.09 71.77 28.19L69.35 22.43C69.01 21.63 68.87 20.76 68.92 19.89C68.97 19.02 69.22 18.17 69.64 17.41L70.13 16.59C70.34 16.26 70.53 15.92 70.7 15.58C71.44 14.06 71.83 12.4 71.83 10.71C71.75 7.82 70.54 5.08 68.47 3.07C66.4 1.05 63.62 -0.07 60.73 -0.07C57.84 -0.07 55.06 1.05 52.99 3.07C50.92 5.08 49.71 7.82 49.63 10.71C49.63 12.4 50.02 14.06 50.76 15.58C50.94 15.92 51.13 16.26 51.33 16.59L51.82 17.41C52.25 18.17 52.49 19.02 52.54 19.89C52.59 20.76 52.45 21.63 52.11 22.43L49.69 28.19C49.32 29.09 48.72 29.87 47.96 30.47C47.2 31.08 46.3 31.48 45.34 31.64L44.62 31.75L43.98 31.86L43.92 31.86C42.61 32.12 41.36 32.62 40.23 33.33L40.07 33.43C40.03 33.45 40 33.47 39.98 33.49C38.45 34.47 37.19 35.81 36.31 37.4L36.31 37.46C36.21 37.64 36.11 37.84 36.02 38.03C31.52 47.67 41.37 53.02 42.61 53.35C44.13 53.81 45.73 53.95 47.31 53.77C48.89 53.59 50.41 53.09 51.78 52.3L51.99 52.16C54.34 50.71 56.06 48.43 56.81 45.77C57.56 43.12 57.29 40.28 56.05 37.81L54.25 34.19C53.89 33.46 53.69 32.66 53.66 31.85C53.63 31.04 53.78 30.23 54.08 29.48L55.8 25.23C56.15 24.2 56.81 23.31 57.69 22.68C58.57 22.05 59.63 21.71 60.71 21.71C61.79 21.71 62.85 22.05 63.73 22.68C64.61 23.31 65.27 24.2 65.62 25.23L67.37 29.48C67.68 30.23 67.82 31.04 67.8 31.85C67.77 32.66 67.57 33.46 67.21 34.19L65.44 37.78C64.34 39.99 64 42.5 64.5 44.92C64.99 47.34 66.28 49.52 68.16 51.12L68.33 51.28C69.77 52.49 71.5 53.31 73.35 53.67C75.2 54.03 77.11 53.92 78.9 53.33C80.54 52.81 82.03 51.9 83.26 50.69L86.13 47.9C86.71 47.33 87.41 46.88 88.17 46.6C88.94 46.31 89.76 46.2 90.58 46.26L95.16 46.6C96.24 46.62 97.29 46.97 98.17 47.6C99.05 48.24 99.7 49.14 100.04 50.16C100.75 52.32 102.52 56.46 109 57.7C110.87 57.97 112.77 57.75 114.53 57.08C116.28 56.41 117.84 55.3 119.05 53.86C120.27 52.42 121.09 50.7 121.45 48.85C121.81 47 121.7 45.1 121.12 43.31L121.18 43.37Z" fill="#EC1D35" fill-opacity="1.000000" fill-rule="nonzero"/>
<path id="Vector" d="M81.12 60.1C79.62 60.62 78.24 61.44 77.07 62.51C75.9 63.59 74.96 64.89 74.32 66.34C74.32 66.42 74.25 66.49 74.23 66.57C73.2 69.12 73.16 71.97 74.11 74.56C75.07 77.15 76.96 79.28 79.41 80.56L82.96 82.42C83.68 82.8 84.31 83.33 84.81 83.97C85.31 84.61 85.66 85.35 85.86 86.14L86.95 90.6C87.28 91.63 87.27 92.75 86.94 93.78C86.6 94.81 85.94 95.71 85.06 96.35C84.18 96.99 83.12 97.33 82.03 97.33C80.94 97.34 79.88 96.99 79 96.36L75.09 93.95C74.39 93.53 73.8 92.97 73.33 92.3C72.88 91.63 72.56 90.87 72.42 90.07L71.74 86.13C71.34 83.7 70.14 81.47 68.32 79.79C66.5 78.12 64.18 77.11 61.72 76.9L61.48 76.9C58.72 76.7 55.99 77.54 53.82 79.25C51.65 80.96 50.19 83.41 49.74 86.14C48.17 95.52 56.62 98.57 59.89 98.99L60.2 98.99C62 99.09 63.81 98.75 65.45 98L65.51 98L66.09 97.71L66.74 97.38C67.61 96.94 68.58 96.73 69.56 96.77C70.53 96.8 71.48 97.09 72.32 97.59L77.68 100.88C78.43 101.34 79.06 101.95 79.53 102.69C80 103.42 80.3 104.25 80.39 105.11L80.51 106.09C80.54 106.47 80.58 106.86 80.65 107.25C80.97 109.1 81.76 110.84 82.94 112.31C84.13 113.77 85.66 114.92 87.41 115.62C89.16 116.33 91.06 116.58 92.93 116.35C94.8 116.13 96.58 115.43 98.11 114.32C99.63 113.21 100.85 111.74 101.65 110.03C102.44 108.33 102.79 106.45 102.66 104.57C102.53 102.69 101.92 100.88 100.89 99.3C99.86 97.72 98.44 96.43 96.78 95.55C96.43 95.37 96.08 95.21 95.71 95.07L94.82 94.65C94.03 94.29 93.33 93.76 92.78 93.09C92.23 92.41 91.83 91.62 91.63 90.78L90.18 84.67C89.96 83.72 89.98 82.73 90.25 81.79C90.51 80.86 91.01 80 91.69 79.31L92.21 78.79C92.37 78.64 92.52 78.49 92.66 78.33L92.66 78.29C93.57 77.31 94.29 76.18 94.79 74.94L94.86 74.76L94.86 74.66C95.52 72.98 95.75 71.16 95.54 69.36L95.54 69.3C94.07 58.58 83.49 59.22 81.12 60.1Z" fill="#402FFF" fill-opacity="1.000000" fill-rule="nonzero"/>
<path id="Vector" d="M174.15 98.32L174.15 89.57L163.44 89.57C161 89.52 158.61 88.83 156.52 87.58C154.21 86.22 150.12 81.72 148.86 79.94C147.62 78 147 75.74 147.08 73.44L147.08 41.91C146.99 39.58 147.61 37.28 148.86 35.32C150.12 33.68 154.21 29.14 156.52 27.78C158.61 26.53 161 25.85 163.44 25.79L174.15 25.79L174.15 17.3L185.8 17.3L185.8 25.78L196.26 25.78C198.69 25.84 201.07 26.53 203.18 27.76C205.49 29.13 209.47 33.63 210.84 35.31C212.09 37.27 212.71 39.57 212.62 41.89L212.62 73.43C212.7 75.72 212.08 77.99 210.84 79.92C209.47 81.71 205.49 86.21 203.18 87.56C201.08 88.8 198.69 89.49 196.26 89.56L185.8 89.56L185.8 98.3L174.15 98.32ZM163.69 77.32L174.15 77.32L174.15 38.03L163.8 38.03C162.33 39.17 161.02 40.51 159.92 42.01L159.92 73.44C160.99 74.91 162.26 76.21 163.69 77.32ZM199.82 41.93C198.82 40.42 197.54 39.1 196.05 38.05L185.8 38.05L185.8 77.34L195.94 77.34C197.37 76.19 198.67 74.89 199.82 73.47L199.82 41.93Z" fill="#EDEDED" fill-opacity="1.000000" fill-rule="nonzero"/>
<path id="Vector" d="M268.09 44.63C266.94 41.93 265 39.63 262.53 38.05L243.89 38.05C242.31 39.23 240.92 40.64 239.77 42.24L239.77 73.46C240.82 75.05 242.23 76.38 243.89 77.33L262.73 77.33C264.99 75.69 266.83 73.54 268.09 71.05L280.05 73.99C279.18 76.37 277.98 78.63 276.48 80.68C273.96 84.25 269.06 89.59 262.64 89.59L243.36 89.59C240.92 89.52 238.54 88.84 236.44 87.6C234.24 86.24 230.25 82.05 228.78 80.06C227.6 78.1 226.98 75.85 226.99 73.57L226.99 41.8C226.9 39.5 227.52 37.23 228.78 35.31C230.03 33.66 234.13 29.23 236.54 27.76C238.62 26.56 240.96 25.88 243.36 25.78L262.64 25.78C269.04 25.78 273.87 31.12 276.38 34.57C277.87 36.62 279.07 38.87 279.95 41.25L268.09 44.63Z" fill="#EDEDED" fill-opacity="1.000000" fill-rule="nonzero"/>
<path id="Vector" d="M332.05 89.05L332.05 38.45L305.54 38.45L305.54 89.05L292.74 89.05L292.74 29.73C292.74 28.8 293.11 27.91 293.77 27.26C294.43 26.6 295.31 26.23 296.24 26.23L341.35 26.23C342.27 26.23 343.16 26.6 343.82 27.26C344.47 27.91 344.84 28.8 344.85 29.73L344.85 89.1L332.05 89.05Z" fill="#EDEDED" fill-opacity="1.000000" fill-rule="nonzero"/>
</svg>

Before

Width:  |  Height:  |  Size: 8.2 KiB

@@ -1,12 +0,0 @@
<svg width="345.000000" height="116.000000" viewBox="0 0 345 116" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<desc>
Created with Pixso.
</desc>
<defs/>
<path id="Vector" d="M36.42 95.22C35.54 94.59 34.88 93.7 34.54 92.67C34.2 91.65 34.2 90.54 34.53 89.51L35.61 85.09C35.81 84.32 36.16 83.59 36.66 82.96C37.15 82.33 37.78 81.8 38.49 81.42L42.03 79.58C44.22 78.46 45.97 76.64 47 74.43C48.02 72.21 48.28 69.72 47.72 67.35L47.67 67.13C47.01 64.47 45.38 62.15 43.08 60.62C40.79 59.09 38 58.46 35.27 58.86L31.3 59.42C30.5 59.54 29.68 59.48 28.89 59.26C28.11 59.04 27.39 58.65 26.76 58.13L23.26 55.19C22.39 54.55 21.75 53.65 21.41 52.63C21.08 51.61 21.08 50.51 21.41 49.48C22.15 47.21 22.13 44.76 21.34 42.51C20.56 40.25 19.05 38.31 17.05 36.98C15.05 35.64 12.67 34.99 10.26 35.11C7.85 35.24 5.55 36.14 3.71 37.68C1.86 39.21 0.57 41.3 0.03 43.63C-0.51 45.95 -0.27 48.39 0.72 50.57C1.7 52.74 3.37 54.55 5.48 55.7C7.59 56.85 10.03 57.3 12.41 56.96C12.8 56.9 13.18 56.82 13.56 56.73L14.59 56.54C15.45 56.37 16.33 56.39 17.17 56.61C18.02 56.83 18.8 57.24 19.46 57.8L24.22 61.88C24.95 62.51 25.51 63.31 25.84 64.21C26.17 65.11 26.27 66.08 26.13 67.02L26.01 67.74L25.91 68.37L25.91 68.43C25.76 69.73 25.84 71.06 26.16 72.34C26.16 72.41 26.16 72.49 26.22 72.55L26.22 72.63C26.67 74.37 27.56 75.97 28.79 77.28C28.94 77.44 29.09 77.58 29.24 77.73L29.76 78.24C30.45 78.93 30.95 79.78 31.21 80.71C31.47 81.64 31.5 82.62 31.27 83.56L29.82 89.6C29.62 90.44 29.23 91.23 28.68 91.9C28.12 92.56 27.42 93.1 26.63 93.45L25.74 93.86C25.38 94 25.02 94.16 24.68 94.34C23.06 95.19 21.67 96.42 20.66 97.93C18.97 100.32 18.32 103.27 18.83 106.14C19.35 109 21 111.55 23.41 113.21C25.82 114.88 28.8 115.53 31.7 115.02C34.6 114.51 37.17 112.88 38.85 110.49C39.85 109.14 40.52 107.58 40.81 105.93C40.88 105.56 40.93 105.18 40.96 104.81L41.08 103.84C41.01 102.15 40.56 100.5 39.75 99C38.94 97.51 37.81 96.22 36.42 95.22Z" fill="#C8C9CA" fill-opacity="1.000000" fill-rule="nonzero"/>
<path id="Vector" d="M121.18 42.71C120.59 40.94 119.56 39.35 118.18 38.08C116.81 36.81 115.12 35.91 113.3 35.46C111.47 35.01 109.56 35.02 107.74 35.51C105.92 35.99 104.26 36.92 102.9 38.21C102.61 38.47 102.34 38.74 102.08 39.03L101.41 39.74C100.82 40.38 100.09 40.87 99.28 41.18C98.47 41.5 97.6 41.63 96.73 41.56L90.47 41.06C89.5 40.98 88.56 40.65 87.75 40.12C86.93 39.58 86.27 38.85 85.82 37.99L85.49 37.35C85.39 37.15 85.3 36.96 85.19 36.78L85.19 36.73C84.54 35.57 83.69 34.55 82.66 33.7L82.5 33.57L82.42 33.5C81.02 32.37 79.36 31.6 77.59 31.25L77.52 31.25L76.89 31.14L76.15 31.08C75.19 30.93 74.28 30.53 73.52 29.93C72.75 29.34 72.15 28.56 71.77 27.67L69.35 21.96C69.01 21.16 68.87 20.3 68.92 19.44C68.97 18.57 69.22 17.74 69.64 16.98L70.13 16.17C70.34 15.84 70.53 15.51 70.7 15.16C71.44 13.67 71.83 12.02 71.83 10.34C71.75 7.48 70.54 4.77 68.47 2.77C66.4 0.78 63.62 -0.34 60.73 -0.34C57.84 -0.34 55.06 0.78 52.99 2.77C50.92 4.77 49.71 7.48 49.63 10.34C49.63 12.02 50.02 13.67 50.76 15.16C50.94 15.51 51.13 15.84 51.33 16.17L51.82 16.98C52.25 17.74 52.49 18.57 52.54 19.44C52.59 20.3 52.45 21.16 52.11 21.96L49.69 27.67C49.32 28.55 48.72 29.33 47.96 29.93C47.2 30.52 46.3 30.92 45.34 31.08L44.62 31.2L43.98 31.3L43.92 31.3C42.61 31.56 41.36 32.05 40.23 32.75L40.07 32.86C40.03 32.87 40 32.89 39.98 32.92C38.45 33.89 37.19 35.22 36.31 36.79L36.31 36.85C36.21 37.03 36.11 37.22 36.02 37.41C31.52 46.97 41.37 52.27 42.61 52.6C44.13 53.05 45.73 53.19 47.31 53.01C48.89 52.83 50.41 52.34 51.78 51.55L51.99 51.42C54.34 49.98 56.06 47.72 56.81 45.09C57.56 42.46 57.29 39.64 56.05 37.2L54.25 33.61C53.89 32.89 53.69 32.1 53.66 31.29C53.63 30.49 53.78 29.68 54.08 28.94L55.8 24.73C56.15 23.71 56.81 22.83 57.69 22.2C58.57 21.58 59.63 21.24 60.71 21.24C61.79 21.24 62.85 21.58 63.73 22.2C64.61 22.83 65.27 23.71 65.62 24.73L67.37 28.94C67.68 29.68 67.82 30.49 67.8 31.29C67.77 32.1 67.57 32.89 67.21 33.61L65.44 37.17C64.34 39.35 64 41.84 64.5 44.24C64.99 46.64 66.28 48.8 68.16 50.39L68.33 50.54C69.77 51.74 71.5 52.56 73.35 52.92C75.2 53.27 77.11 53.16 78.9 52.58C80.54 52.06 82.03 51.16 83.26 49.96L86.13 47.2C86.71 46.63 87.41 46.19 88.17 45.91C88.94 45.62 89.76 45.51 90.58 45.57L95.16 45.91C96.24 45.92 97.29 46.27 98.17 46.9C99.05 47.54 99.7 48.42 100.04 49.44C100.75 51.58 102.52 55.68 109 56.91C110.87 57.17 112.77 56.96 114.53 56.29C116.28 55.63 117.84 54.53 119.05 53.1C120.27 51.67 121.09 49.97 121.45 48.14C121.81 46.31 121.7 44.42 121.12 42.65L121.18 42.71Z" fill="#EC1D35" fill-opacity="1.000000" fill-rule="nonzero"/>
<path id="Vector" d="M81.12 59.28C79.62 59.8 78.24 60.61 77.07 61.68C75.9 62.74 74.96 64.03 74.32 65.47C74.32 65.55 74.25 65.62 74.23 65.69C73.2 68.23 73.16 71.05 74.11 73.61C75.07 76.18 76.96 78.3 79.41 79.56L82.96 81.4C83.68 81.78 84.31 82.3 84.81 82.94C85.31 83.57 85.66 84.3 85.86 85.09L86.95 89.51C87.28 90.53 87.27 91.64 86.94 92.66C86.6 93.68 85.94 94.57 85.06 95.21C84.18 95.84 83.12 96.18 82.03 96.18C80.94 96.18 79.88 95.85 79 95.22L75.09 92.83C74.39 92.41 73.8 91.86 73.33 91.19C72.88 90.53 72.56 89.78 72.42 88.98L71.74 85.08C71.34 82.67 70.14 80.46 68.32 78.8C66.5 77.15 64.18 76.14 61.72 75.94L61.48 75.94C58.72 75.74 55.99 76.57 53.82 78.26C51.65 79.95 50.19 82.39 49.74 85.09C48.17 94.38 56.62 97.41 59.89 97.82L60.2 97.82C62 97.93 63.81 97.59 65.45 96.84L65.51 96.84L66.09 96.55L66.74 96.23C67.61 95.79 68.58 95.58 69.56 95.62C70.53 95.66 71.48 95.94 72.32 96.44L77.68 99.7C78.43 100.15 79.06 100.76 79.53 101.49C80 102.21 80.3 103.04 80.39 103.89L80.51 104.85C80.54 105.24 80.58 105.62 80.65 106C80.97 107.84 81.76 109.57 82.94 111.02C84.13 112.47 85.67 113.6 87.41 114.31C89.16 115.01 91.06 115.26 92.93 115.03C94.8 114.81 96.58 114.11 98.11 113.02C99.63 111.92 100.85 110.46 101.65 108.77C102.44 107.07 102.79 105.21 102.66 103.35C102.53 101.49 101.92 99.69 100.89 98.13C99.86 96.57 98.44 95.29 96.78 94.42C96.43 94.24 96.08 94.08 95.71 93.93L94.82 93.53C94.03 93.17 93.33 92.64 92.78 91.97C92.23 91.31 91.83 90.52 91.63 89.69L90.18 83.63C89.96 82.69 89.98 81.71 90.25 80.78C90.51 79.85 91.01 79.01 91.69 78.32L92.21 77.8C92.37 77.66 92.52 77.51 92.66 77.36L92.66 77.31C93.57 76.34 94.29 75.22 94.79 74L94.86 73.81L94.86 73.72C95.52 72.05 95.75 70.25 95.54 68.47L95.54 68.4C94.07 57.78 83.49 58.41 81.12 59.28Z" fill="#402FFF" fill-opacity="1.000000" fill-rule="nonzero"/>
<path id="Vector" d="M174.15 97.16L174.15 88.49L163.44 88.49C161 88.44 158.61 87.76 156.52 86.52C154.21 85.17 150.12 80.71 148.86 78.94C147.62 77.03 147 74.78 147.08 72.51L147.08 41.26C146.99 38.95 147.61 36.68 148.86 34.73C150.12 33.1 154.21 28.61 156.52 27.25C158.61 26.02 161 25.34 163.44 25.29L174.15 25.29L174.15 16.87L185.8 16.87L185.8 25.27L196.26 25.27C198.69 25.34 201.07 26.02 203.18 27.24C205.49 28.59 209.47 33.05 210.84 34.72C212.09 36.66 212.71 38.94 212.62 41.24L212.62 72.49C212.7 74.76 212.08 77.01 210.84 78.93C209.47 80.69 205.49 85.16 203.18 86.5C201.08 87.73 198.69 88.41 196.26 88.47L185.8 88.47L185.8 97.14L174.15 97.16ZM163.69 76.35L174.15 76.35L174.15 37.42L163.8 37.42C162.33 38.54 161.02 39.87 159.92 41.36L159.92 72.51C160.99 73.96 162.26 75.25 163.69 76.35ZM199.82 41.28C198.82 39.78 197.54 38.48 196.05 37.44L185.8 37.44L185.8 76.37L195.94 76.37C197.37 75.23 198.67 73.94 199.82 72.53L199.82 41.28Z" fill="#1B1C21" fill-opacity="1.000000" fill-rule="nonzero"/>
<path id="Vector" d="M268.09 43.96C266.94 41.28 265 39 262.53 37.43L243.89 37.43C242.31 38.6 240.92 40 239.77 41.58L239.77 72.52C240.82 74.1 242.23 75.41 243.89 76.36L262.73 76.36C264.99 74.74 266.83 72.6 268.09 70.13L280.05 73.05C279.18 75.41 277.98 77.65 276.48 79.68C273.96 83.21 269.06 88.51 262.64 88.51L243.36 88.51C240.92 88.44 238.54 87.76 236.44 86.53C234.24 85.19 230.25 81.04 228.78 79.06C227.6 77.12 226.98 74.9 226.99 72.63L226.99 41.15C226.9 38.87 227.52 36.62 228.78 34.72C230.03 33.09 234.13 28.7 236.54 27.24C238.62 26.05 240.96 25.38 243.36 25.27L262.64 25.27C269.04 25.27 273.87 30.57 276.38 33.99C277.87 36.02 279.07 38.25 279.95 40.6L268.09 43.96Z" fill="#1B1C21" fill-opacity="1.000000" fill-rule="nonzero"/>
<path id="Vector" d="M332.05 87.98L332.05 37.83L305.54 37.83L305.54 87.98L292.74 87.98L292.74 29.19C292.74 28.27 293.11 27.39 293.77 26.74C294.43 26.09 295.31 25.73 296.24 25.72L341.35 25.72C342.27 25.73 343.16 26.09 343.82 26.74C344.47 27.39 344.84 28.27 344.85 29.19L344.85 88.02L332.05 87.98Z" fill="#1B1C21" fill-opacity="1.000000" fill-rule="nonzero"/>
</svg>

Before

Width:  |  Height:  |  Size: 8.2 KiB

@@ -0,0 +1,73 @@
.root {
display: inline-flex;
gap: var(--space-3);
align-items: center;
min-width: 0;
}
.link {
display: inline-flex;
gap: 0.14em;
align-items: center;
min-height: var(--control-height);
padding-inline: var(--space-1);
margin-inline: calc(-1 * var(--space-1));
border-radius: var(--radius-xs);
color: var(--color-text-strong);
font-size: 1.3125rem;
text-decoration: none;
}
.root[data-size="s"] .link {
font-size: 1.0625rem;
}
/* Wide geometric display face with tight tracking: the name reads as one
* mark, not as a word in a sentence. */
.word {
font-family: var(--font-display);
font-weight: 700;
letter-spacing: -0.045em;
line-height: 1;
}
/* Terminal caret: a bar in the action color, cap height tall. It blinks a
* few times after the page loads and then stays lit. */
.caret {
flex: none;
width: 0.2em;
height: 0.78em;
margin-top: 0.02em;
border-radius: 1px;
background: var(--color-action);
animation: caret-blink 1.1s steps(1, end) 3;
}
.link:hover .caret {
background: var(--color-accent);
}
/* Cabinet name: a mono label separated by a hairline. */
.context {
padding-left: var(--space-3);
border-left: var(--line-thin) solid var(--color-divider);
color: var(--color-text-secondary);
font-family: var(--font-mono);
font-size: var(--font-size-xs);
font-weight: var(--font-weight-medium);
letter-spacing: 0.02em;
line-height: var(--line-height-snug);
white-space: nowrap;
}
@keyframes caret-blink {
50% {
opacity: 0;
}
}
@media (prefers-reduced-motion: reduce) {
.caret {
animation: none;
}
}
+31
View File
@@ -0,0 +1,31 @@
import { Link } from "react-router-dom";
import styles from "./wordmark.module.css";
const productName = "Lincodex";
type WordmarkProps = {
/** Destination of the home link. */
to?: string;
/** Cabinet name shown next to the wordmark, outside the link. */
context?: string | undefined;
/** Compact size for footers and narrow headers. */
size?: "m" | "s";
};
/**
* The Lincodex wordmark: the product name set in Unbounded with a terminal
* caret in the action blue. It is text, so the link's accessible name is
* exactly "Lincodex"; the caret is decoration. The cabinet name sits beside
* the link and does not change that name.
*/
export function Wordmark({ to = "/", context, size = "m" }: WordmarkProps) {
return (
<span className={styles.root} data-size={size}>
<Link to={to} className={styles.link}>
<span className={styles.word}>{productName}</span>
<span className={styles.caret} aria-hidden="true" />
</Link>
{context ? <span className={styles.context}>{context}</span> : null}
</span>
);
}
+54 -20
View File
@@ -1,63 +1,97 @@
/* Every control is a capsule. Labels are set in JetBrains Mono. */
.root {
display: inline-flex;
gap: var(--space-2);
align-items: center;
justify-content: center;
min-height: 2.75rem;
min-height: var(--control-height);
padding: var(--space-2) var(--space-5);
border: var(--line-strong) solid transparent;
border: var(--line-thin) solid transparent;
border-radius: var(--radius-pill);
font-size: var(--font-size-m);
font-weight: var(--font-weight-bold);
font-family: var(--font-mono);
font-size: 0.9375rem;
font-weight: var(--font-weight-medium);
letter-spacing: -0.005em;
line-height: var(--line-height-snug);
text-align: center;
text-decoration: none;
cursor: pointer;
transition:
background-color var(--duration-fast) var(--easing-standard),
color var(--duration-fast) var(--easing-standard),
background-color var(--duration-base) var(--easing-standard),
border-color var(--duration-fast) var(--easing-standard),
color var(--duration-base) var(--easing-standard),
transform var(--duration-fast) var(--easing-standard);
}
.root:active {
transform: translateY(1px);
transform: scale(0.98);
}
.root[aria-disabled="true"] {
cursor: progress;
}
/* White on violet: 6.84:1. */
/* A busy button keeps its label and shows a running underline. */
.root[aria-busy="true"] {
background-image: linear-gradient(currentcolor, currentcolor);
background-position: -40% calc(100% - 0.5rem);
background-repeat: no-repeat;
background-size: 30% 1px;
animation: busy 1.1s var(--easing-standard) infinite;
}
/* White on blue 6.84:1. Hover inverts: blue on paper 5.85:1. */
.primary {
color: var(--color-on-accent);
background: var(--color-accent);
color: var(--color-on-action);
background-color: var(--color-action);
}
.primary:hover {
background: var(--palette-graphite);
color: var(--color-on-action-hover);
background-color: var(--color-action-hover);
}
/* Graphite border and text on white: 17.01:1. */
.primary:active {
color: var(--color-on-action);
background-color: var(--color-action-pressed);
}
/* Paper on the elevated graphite 11.52:1; hover white on line 9.9:1. */
.secondary {
border-color: var(--color-border-strong);
border-color: var(--color-border-hover);
color: var(--color-text);
background: var(--color-surface);
background-color: var(--color-surface-elevated);
}
.secondary:hover {
border-color: var(--color-accent);
color: var(--color-accent);
border-color: var(--color-border-strong);
color: var(--color-text-strong);
background-color: var(--color-surface-hover);
}
/* Violet text on white 6.84:1, on light grey 5.85:1. */
/* Link-like action: violet 6.42:1 on canvas, 6.05:1 on surface. */
.quiet {
padding-inline: var(--space-3);
color: var(--color-link);
background: transparent;
background-color: transparent;
text-decoration: underline;
text-underline-offset: 0.2em;
text-decoration-thickness: var(--line-thin);
text-underline-offset: 0.25em;
}
.quiet:hover {
text-decoration-thickness: var(--line-strong);
color: var(--color-link-hover);
}
@keyframes busy {
to {
background-position: 140% calc(100% - 0.5rem);
}
}
@media (prefers-reduced-motion: reduce) {
.root[aria-busy="true"] {
animation: none;
background-position: center calc(100% - 0.5rem);
}
}
@@ -0,0 +1,26 @@
.root {
display: grid;
gap: var(--space-3);
min-width: 0;
padding: var(--space-5);
border: var(--line-thin) solid var(--color-divider);
border-radius: var(--radius-m);
background: var(--color-surface);
}
.root[data-tone="inset"] {
padding: var(--space-4);
border-radius: var(--radius-s);
background: var(--color-canvas);
}
.root[data-tone="panel"] {
padding: var(--space-6) var(--space-5);
border-radius: var(--radius-l);
}
@media (width >= 48rem) {
.root[data-tone="panel"] {
padding: var(--space-7);
}
}
+31
View File
@@ -0,0 +1,31 @@
import type { ReactNode } from "react";
import styles from "./card.module.css";
type CardProps = {
/** Element to render; a card in a list is an li. */
as?: "div" | "section" | "article" | "li";
/**
* raised - a container on the canvas (radius 24);
* inset - a surface nested inside a card (radius 16);
* panel - a large page section (radius 32).
*/
tone?: "raised" | "inset" | "panel";
/** Id of the heading that names a section or article card. */
labelledBy?: string | undefined;
className?: string | undefined;
children: ReactNode;
};
/** Content container: graphite step plus a hairline, no shadow. */
export function Card({ as = "div", tone = "raised", labelledBy, className, children }: CardProps) {
const Element = as;
return (
<Element
className={className ? `${styles.root} ${className}` : styles.root}
data-tone={tone}
aria-labelledby={labelledBy}
>
{children}
</Element>
);
}
@@ -0,0 +1,47 @@
.root {
display: block;
pointer-events: none;
}
.line {
stroke: var(--color-trace);
stroke-dasharray: 1;
stroke-dashoffset: 1;
stroke-linecap: round;
stroke-width: 1.5;
vector-effect: non-scaling-stroke;
animation: draw 1.2s ease-out forwards;
}
.late {
animation-delay: 150ms;
}
.later {
animation-delay: 300ms;
}
.node {
fill: var(--color-canvas);
stroke: var(--color-trace);
stroke-width: 1.5;
vector-effect: non-scaling-stroke;
}
/* One lit node in the readable accent marks the live end of the trace. */
.lit {
fill: var(--color-accent);
}
@keyframes draw {
to {
stroke-dashoffset: 0;
}
}
@media (prefers-reduced-motion: reduce) {
.line {
stroke-dashoffset: 0;
animation: none;
}
}
@@ -0,0 +1,36 @@
import styles from "./circuit-trace.module.css";
type CircuitTraceProps = {
className?: string | undefined;
};
/**
* Decorative circuit traces: thin lines with rounded turns and 8px nodes at
* their ends, the decor of the design system. The lines draw themselves once
* when they appear; reduced motion shows them drawn. Hidden from assistive
* technology.
*/
export function CircuitTrace({ className }: CircuitTraceProps) {
return (
<svg
className={className ? `${styles.root} ${className}` : styles.root}
viewBox="0 0 240 140"
fill="none"
aria-hidden="true"
focusable="false"
preserveAspectRatio="xMaxYMid meet"
>
<path className={styles.line} pathLength={1} d="M4 36H132a24 24 0 0 1 24 24V136" />
<path
className={`${styles.line} ${styles.late}`}
pathLength={1}
d="M60 112H84a24 24 0 0 0 24-24V64a24 24 0 0 1 24-24h104"
/>
<path className={`${styles.line} ${styles.later}`} pathLength={1} d="M196 4V76" />
<circle className={styles.node} cx="4" cy="36" r="4" />
<circle className={styles.node} cx="60" cy="112" r="4" />
<circle className={styles.node} cx="196" cy="80" r="4" />
<circle className={styles.lit} cx="236" cy="40" r="4" />
</svg>
);
}
@@ -0,0 +1,30 @@
/* The frame spans the window and holds the inset; the plate floats in it. */
.frame {
padding: var(--chrome-inset) var(--chrome-inset) 0;
}
/* Dark variant of the design system's floating plate: a light bar would be
* the brightest object on every dark screen and compete with the one action
* color. The graphite glass keeps the plate's shape and inset. */
.plate {
position: relative;
display: flex;
gap: var(--space-3);
align-items: center;
justify-content: space-between;
width: 100%;
max-width: calc(var(--content-width-wide) + 2 * var(--gutter));
min-height: var(--header-height);
margin-inline: auto;
padding: var(--space-1) var(--space-2) var(--space-1) var(--space-4);
border: var(--line-thin) solid var(--color-divider);
border-radius: var(--radius-m);
background: rgb(32 33 41 / 88%);
backdrop-filter: blur(14px) saturate(140%);
}
@supports not (backdrop-filter: blur(1px)) {
.plate {
background: var(--color-surface);
}
}
@@ -0,0 +1,21 @@
import type { ReactNode } from "react";
import styles from "./header-plate.module.css";
type HeaderPlateProps = {
/** Classes of the shell that lay out the plate's content. */
className?: string | undefined;
children: ReactNode;
};
/**
* The floating header plate of every shell: a dark glass bar with radius 24,
* inset from the window edges and sticky at the top. Shells place the
* wordmark, navigation, and menu button inside it.
*/
export function HeaderPlate({ className, children }: HeaderPlateProps) {
return (
<div className={styles.frame}>
<div className={className ? `${styles.plate} ${className}` : styles.plate}>{children}</div>
</div>
);
}
+15 -2
View File
@@ -1,11 +1,19 @@
export { BrandLogo } from "./brand/brand-logo";
export { Wordmark } from "./brand/wordmark";
export { Button, ButtonLink, type ButtonVariant } from "./button/button";
export { Card } from "./card/card";
export { CircuitTrace } from "./decor/circuit-trace";
export { HeaderPlate } from "./header-plate/header-plate";
export { Page } from "./layout/page";
export { Section } from "./layout/section";
export { Stack } from "./layout/stack";
export { NavItem, TextLink, type NavItemTone } from "./link/text-link";
export { NavItem, TextLink, type NavItemLayout } from "./link/text-link";
export { MainRegion, mainContentId } from "./main-region/main-region";
export { MenuButton } from "./menu-button/menu-button";
export { useMenuToggle } from "./menu-button/use-menu-toggle";
export { Mono } from "./mono/mono";
export { Notice, type NoticeTone } from "./notice/notice";
export { SegmentedControl, type SegmentedOption } from "./segmented-control/segmented-control";
export { Skeleton } from "./skeleton/skeleton";
export { SkipLink } from "./skip-link/skip-link";
export { describeError, isAccessDenied, type ErrorDescription } from "./status-view/describe-error";
export { QueryView, type QueryViewSource } from "./status-view/query-view";
@@ -19,6 +27,11 @@ export {
type SavingStatusValue,
type StatusKind,
} from "./status-view/status-view";
export { buildSteps, type StepStatus, type StepperStep } from "./stepper/build-steps";
export { Stepper } from "./stepper/stepper";
export { tabKeyTarget } from "./tabs/tab-keys";
export { Tabs, type TabItem } from "./tabs/tabs";
export { AttentionDot, Tag, type TagTone } from "./tag/tag";
export { TrustLevel } from "./trust-level/trust-level";
export { trustLevelLabels, type TrustLevelValue } from "./trust-level/trust-level-labels";
export { VisuallyHidden } from "./visually-hidden/visually-hidden";
+39 -19
View File
@@ -12,43 +12,61 @@
max-width: calc(var(--content-width-wide) + 2 * var(--gutter));
}
/* The header closes with a hairline trace that starts at a node. */
.page-header {
position: relative;
display: grid;
gap: var(--space-3);
padding-bottom: var(--space-5);
border-bottom: var(--line-thin) solid var(--color-divider);
}
.page-header::after {
position: absolute;
bottom: -0.25rem;
left: 0;
width: 0.5rem;
height: 0.5rem;
border-radius: 50%;
content: "";
background: var(--color-accent);
}
/* Mono label above the title, steel on canvas 6.19:1. */
.eyebrow {
color: var(--color-accent);
color: var(--color-text-secondary);
font-family: var(--font-mono);
font-size: var(--font-size-xs);
font-weight: var(--font-weight-bold);
font-weight: var(--font-weight-medium);
letter-spacing: var(--letter-spacing-label);
text-transform: uppercase;
}
.title {
font-size: var(--font-size-display);
font-weight: var(--font-weight-bold);
color: var(--color-text-strong);
font-size: var(--font-size-title);
font-weight: var(--font-weight-medium);
letter-spacing: var(--letter-spacing-display);
line-height: var(--line-height-tight);
line-height: 1.25;
overflow-wrap: anywhere;
hyphens: auto;
}
.lead {
max-width: 38rem;
max-width: 42rem;
color: var(--color-text-secondary);
font-size: var(--font-size-l);
font-size: 1.0625rem;
line-height: var(--line-height-body);
}
.page-body {
display: grid;
gap: var(--space-6);
gap: var(--space-7);
padding-top: var(--space-6);
}
/* A section hangs on a circuit trace: a node at the heading and a hairline
* down the left edge that turns with a rounded corner. */
.section {
position: relative;
display: grid;
@@ -56,31 +74,33 @@
padding-left: var(--space-5);
}
/* Node at the heading plus a thin line down the section. */
.connector {
position: absolute;
top: 0.55em;
top: 0.7em;
bottom: 0;
left: 0;
left: 0.1875rem;
width: var(--space-3);
border-left: var(--line-thin) solid var(--color-accent);
border-bottom-left-radius: var(--radius-m);
border-bottom-left-radius: var(--radius-s);
border-left: var(--line-thin) solid var(--color-divider);
}
.connector::before {
position: absolute;
top: -0.3rem;
left: calc(-0.3rem - 0.5px);
width: 0.6rem;
height: 0.6rem;
top: -0.25rem;
left: calc(-0.25rem - 0.5px);
width: 0.5rem;
height: 0.5rem;
border: var(--line-thin) solid var(--color-accent);
border-radius: 50%;
content: "";
background: var(--color-accent);
background: var(--color-canvas);
}
.section-title {
color: var(--color-text-strong);
font-size: var(--font-size-xl);
font-weight: var(--font-weight-bold);
font-weight: var(--font-weight-medium);
letter-spacing: -0.015em;
}
.section-description {
@@ -1,67 +1,54 @@
/* Violet on canvas 6.42:1, on surface 6.05:1, on the elevated surface 5.09:1.
* Links are underlined so color is not the only cue. */
.link {
border-radius: var(--radius-xs);
color: var(--color-link);
text-decoration: underline;
text-decoration-color: color-mix(in srgb, currentcolor 55%, transparent);
text-decoration-thickness: var(--line-thin);
text-underline-offset: 0.2em;
text-underline-offset: 0.22em;
transition:
color var(--duration-fast) var(--easing-standard),
text-decoration-color var(--duration-fast) var(--easing-standard);
}
.link:hover {
text-decoration-thickness: var(--line-strong);
color: var(--color-link-hover);
text-decoration-color: currentcolor;
}
/* Cabinet navigation: a mono capsule. The current section is inverted to
* paper with graphite text (14.53:1), the "you are here" signal of the
* design system; the fill change does not rely on hue. */
.nav {
position: relative;
display: inline-flex;
align-items: center;
min-height: 2.75rem;
padding: var(--space-2) var(--space-3);
border-radius: var(--radius-s);
min-height: 2.5rem;
padding: var(--space-2) 0.875rem;
border-radius: var(--radius-pill);
color: var(--color-text-secondary);
font-family: var(--font-mono);
font-size: var(--font-size-s);
font-weight: var(--font-weight-medium);
line-height: var(--line-height-snug);
text-decoration: none;
white-space: nowrap;
transition:
background-color var(--duration-fast) var(--easing-standard),
color var(--duration-fast) var(--easing-standard);
}
/* Active marker: a bar under the label plus bold text. */
.nav::after {
position: absolute;
right: var(--space-3);
bottom: var(--space-1);
left: var(--space-3);
height: var(--line-strong);
border-radius: var(--radius-pill);
content: "";
background: currentcolor;
transform: scaleX(0);
transform-origin: left;
transition: transform var(--duration-base) var(--easing-standard);
.nav:hover {
color: var(--color-text);
background-color: var(--color-surface-tint-hover);
}
.nav[aria-current="page"] {
font-weight: var(--font-weight-bold);
color: var(--color-on-inverse);
background-color: var(--color-inverse);
}
.nav[aria-current="page"]::after {
transform: scaleX(1);
}
/* Graphite on white 17.01:1; active violet on white 6.84:1. */
.light {
color: var(--color-text);
}
.light:hover,
.light[aria-current="page"] {
color: var(--color-accent);
}
/* Light grey on graphite 14.53:1; white on graphite 17.01:1. */
.dark {
color: var(--palette-light);
}
.dark:hover,
.dark[aria-current="page"] {
color: var(--palette-white);
/* Rail layout: full-width items in a vertical list. */
.rail {
width: 100%;
}
+9 -7
View File
@@ -10,21 +10,23 @@ export function TextLink({ className, ...rest }: TextLinkProps) {
return <Link {...rest} className={className ? `${styles.link} ${className}` : styles.link} />;
}
export type NavItemTone = "light" | "dark";
export type NavItemLayout = "row" | "rail";
type NavItemProps = Omit<NavLinkProps, "className" | "children"> & {
tone?: NavItemTone;
/** "rail" stretches the item to the width of a vertical list. */
layout?: NavItemLayout;
children: string;
};
/**
* Navigation link of a cabinet. NavLink sets aria-current="page" on the
* active item; the active state is shown by a bar and a heavier weight, not
* by color alone.
* Navigation link of a shell. NavLink sets aria-current="page" on the active
* item; the active item is an inverted capsule, a change of fill rather than
* of hue alone.
*/
export function NavItem({ tone = "light", children, ...rest }: NavItemProps) {
export function NavItem({ layout = "row", children, ...rest }: NavItemProps) {
const className = layout === "rail" ? `${styles.nav} ${styles.rail}` : (styles.nav ?? "");
return (
<NavLink {...rest} className={`${styles.nav} ${styles[tone]}`}>
<NavLink {...rest} className={className}>
{children}
</NavLink>
);
@@ -0,0 +1,58 @@
.root {
display: inline-flex;
gap: var(--space-2);
align-items: center;
min-height: 2.5rem;
padding: var(--space-2) var(--space-4);
border: var(--line-thin) solid var(--color-border-hover);
border-radius: var(--radius-pill);
color: var(--color-text);
font-family: var(--font-mono);
font-size: var(--font-size-s);
font-weight: var(--font-weight-medium);
cursor: pointer;
background: var(--color-surface-elevated);
}
.root:hover {
border-color: var(--color-border-strong);
}
.root[aria-expanded="true"] {
color: var(--color-on-inverse);
background: var(--color-inverse);
}
/* Two bars that turn into a cross when the menu is open. */
.icon {
position: relative;
display: inline-block;
width: 0.875rem;
height: 0.625rem;
}
.icon span {
position: absolute;
left: 0;
width: 100%;
height: 1.5px;
border-radius: 1px;
background: currentcolor;
transition: transform var(--duration-base) var(--easing-emphasized);
}
.icon span:first-child {
top: 0;
}
.icon span:last-child {
bottom: 0;
}
.icon[data-open] span:first-child {
transform: translateY(0.28rem) rotate(45deg);
}
.icon[data-open] span:last-child {
transform: translateY(-0.28rem) rotate(-45deg);
}
@@ -0,0 +1,33 @@
import type { RefObject } from "react";
import styles from "./menu-button.module.css";
type MenuButtonProps = {
menuId: string;
isOpen: boolean;
onToggle: () => void;
buttonRef: RefObject<HTMLButtonElement | null>;
className?: string | undefined;
};
/**
* Button that shows or hides a collapsed navigation menu. The visible label
* stays "Меню"; aria-expanded tells whether the menu is open.
*/
export function MenuButton({ menuId, isOpen, onToggle, buttonRef, className }: MenuButtonProps) {
return (
<button
ref={buttonRef}
type="button"
className={className ? `${styles.root} ${className}` : styles.root}
aria-expanded={isOpen}
aria-controls={menuId}
onClick={onToggle}
>
<span className={styles.icon} aria-hidden="true" data-open={isOpen || undefined}>
<span />
<span />
</span>
Меню
</button>
);
}
@@ -0,0 +1,39 @@
import { useCallback, useEffect, useId, useRef, useState } from "react";
import { useLocation } from "react-router-dom";
/**
* State of a navigation menu that collapses behind a button on narrow
* screens. The menu closes after a navigation and on Escape; Escape returns
* focus to the button so keyboard users keep their place.
*/
export function useMenuToggle() {
const menuId = useId();
const buttonRef = useRef<HTMLButtonElement>(null);
const [isOpen, setIsOpen] = useState(false);
const { pathname } = useLocation();
const [openedAt, setOpenedAt] = useState(pathname);
// A navigation closes the menu. Comparing during render avoids an effect
// that would set state after the new page has painted.
if (isOpen && openedAt !== pathname) {
setIsOpen(false);
}
useEffect(() => {
if (!isOpen) return undefined;
function handleKeyDown(event: KeyboardEvent) {
if (event.key !== "Escape") return;
setIsOpen(false);
buttonRef.current?.focus();
}
document.addEventListener("keydown", handleKeyDown);
return () => document.removeEventListener("keydown", handleKeyDown);
}, [isOpen]);
const toggle = useCallback(() => {
setOpenedAt(pathname);
setIsOpen((open) => !open);
}, [pathname]);
return { menuId, buttonRef, isOpen, toggle };
}
@@ -1,6 +1,7 @@
.root {
font-family: var(--font-mono);
font-size: 0.94em;
font-variant-ligatures: none;
font-variant-numeric: tabular-nums slashed-zero;
font-weight: var(--font-weight-regular);
letter-spacing: 0;
@@ -8,5 +9,6 @@
}
.strong {
color: var(--color-text-strong);
font-weight: var(--font-weight-bold);
}
@@ -0,0 +1,45 @@
.root {
display: grid;
gap: var(--space-2);
padding: var(--space-3) var(--space-4);
border: var(--line-thin) solid var(--color-divider);
border-left: var(--line-strong) solid var(--color-accent);
border-radius: var(--radius-s);
background: var(--color-canvas);
}
.root[data-tone="success"] {
border-left-color: var(--color-success);
}
.root[data-tone="danger"] {
border-color: var(--color-danger);
}
.root[data-tone="neutral"] {
border-left-color: var(--color-border-strong);
}
.title {
color: var(--color-text-strong);
font-family: var(--font-mono);
font-size: 0.9375rem;
font-weight: var(--font-weight-medium);
line-height: var(--line-height-snug);
}
.root[data-tone="danger"] .title {
color: var(--color-danger);
}
.body {
color: var(--color-text-secondary);
font-size: var(--font-size-s);
}
.action {
display: flex;
flex-wrap: wrap;
gap: var(--space-2);
padding-top: var(--space-1);
}
+27
View File
@@ -0,0 +1,27 @@
import type { ReactNode } from "react";
import styles from "./notice.module.css";
export type NoticeTone = "info" | "success" | "danger" | "neutral";
type NoticeProps = {
tone?: NoticeTone;
title?: ReactNode;
/** "status" or "alert" when the notice appears in response to an action. */
role?: "status" | "alert" | undefined;
action?: ReactNode;
children?: ReactNode;
};
/**
* Inline message inside a page or a card: a nested surface with a state
* stripe. The title and text carry the meaning; the stripe repeats it.
*/
export function Notice({ tone = "info", title, role, action, children }: NoticeProps) {
return (
<div className={styles.root} data-tone={tone} role={role}>
{title ? <p className={styles.title}>{title}</p> : null}
{children ? <div className={styles.body}>{children}</div> : null}
{action ? <div className={styles.action}>{action}</div> : null}
</div>
);
}
+162
View File
@@ -0,0 +1,162 @@
import { renderToStaticMarkup } from "react-dom/server";
import { MemoryRouter } from "react-router-dom";
import { describe, expect, it } from "vitest";
import { Wordmark } from "./brand/wordmark";
import { SegmentedControl } from "./segmented-control/segmented-control";
import { Skeleton } from "./skeleton/skeleton";
import { buildSteps } from "./stepper/build-steps";
import { Stepper } from "./stepper/stepper";
import { tabKeyTarget } from "./tabs/tab-keys";
import { Tabs } from "./tabs/tabs";
import { AttentionDot, Tag } from "./tag/tag";
function text(html: string): string {
return html
.replace(/<[^>]+>/g, " ")
.replace(/\s+/g, " ")
.trim();
}
describe("Wordmark", () => {
it("names the home link exactly Lincodex and keeps the cabinet name outside it", () => {
const html = renderToStaticMarkup(
<MemoryRouter>
<Wordmark to="/candidate" context="Кабинет кандидата" />
</MemoryRouter>,
);
const link = html.match(/<a[^>]*>(.*?)<\/a>/);
expect(link?.[0]).toContain('href="/candidate"');
expect(text(link?.[1] ?? "")).toBe("Lincodex");
expect(link?.[1]).toMatch(/aria-hidden="true"/);
expect(text(html)).toBe("Lincodex Кабинет кандидата");
expect(html).not.toContain("<img");
});
});
describe("Stepper", () => {
const steps = [
{ id: "account", label: "Данные аккаунта" },
{ id: "code", label: "Код из письма" },
{ id: "profile", label: "Профиль" },
];
it("marks steps before the current one complete and the rest upcoming", () => {
expect(buildSteps(steps, 1).map((step) => step.status)).toEqual([
"complete",
"current",
"upcoming",
]);
expect(buildSteps(steps, 3).every((step) => step.status === "complete")).toBe(true);
});
it("states the position and each status in text, with aria-current on the current step", () => {
const html = renderToStaticMarkup(
<Stepper label="Шаги регистрации" steps={buildSteps(steps, 1)} />,
);
expect(html).toMatch(/<ol[^>]*aria-label="Шаги регистрации"/);
expect(text(html)).toContain("Шаг 2 из 3");
expect(text(html)).toContain("Данные аккаунта , выполнен");
expect(text(html)).toContain("Код из письма , текущий шаг");
expect(text(html)).toContain("Профиль , впереди");
expect(html.match(/aria-current="step"/g)).toHaveLength(1);
expect(html).toMatch(/<li[^>]*data-status="current"[^>]*aria-current="step"/);
});
it("reports a finished flow", () => {
const html = renderToStaticMarkup(<Stepper label="Шаги" steps={buildSteps(steps, 3)} />);
expect(text(html)).toContain("Все шаги выполнены: 3 из 3");
expect(html).not.toContain('aria-current="step"');
});
});
describe("Tabs", () => {
const items = [
{ id: "basis", label: "Основание", content: <p>Первая панель</p> },
{ id: "filters", label: "Фильтры", content: <p>Вторая панель</p> },
];
it("links each tab to its panel and keeps only the selected tab in the tab order", () => {
const html = renderToStaticMarkup(
<Tabs label="Параметры поиска" items={items} defaultValue="filters" />,
);
expect(html).toMatch(/role="tablist" aria-label="Параметры поиска"/);
const tabs = [...html.matchAll(/<button[^>]*role="tab"[^>]*>/g)].map((match) => match[0]);
expect(tabs).toHaveLength(2);
expect(tabs[0]).toContain('aria-selected="false"');
expect(tabs[0]).toContain('tabindex="-1"');
expect(tabs[1]).toContain('aria-selected="true"');
expect(tabs[1]).toContain('tabindex="0"');
// Inactive panels stay mounted so form state in them survives.
expect(html).toMatch(/<div role="tabpanel"[^>]*hidden=""[^>]*><p>Первая панель<\/p>/);
expect(html).toMatch(/<div role="tabpanel"(?![^>]*hidden)[^>]*><p>Вторая панель<\/p>/);
const firstControls = tabs[0]?.match(/aria-controls="([^"]+)"/)?.[1];
expect(html).toContain(`id="${firstControls}"`);
});
it.each([
["ArrowRight", 2, 0],
["ArrowLeft", 0, 2],
["Home", 1, 0],
["End", 0, 2],
["ArrowRight", 0, 1],
] as const)("moves %s from tab %i to tab %i of three", (key, from, to) => {
expect(tabKeyTarget(key, from, 3)).toBe(to);
});
it("ignores other keys and empty lists", () => {
expect(tabKeyTarget("Enter", 0, 3)).toBeNull();
expect(tabKeyTarget("ArrowRight", 0, 0)).toBeNull();
});
});
describe("SegmentedControl", () => {
it("is a native radio group named by its legend", () => {
const html = renderToStaticMarkup(
<SegmentedControl
legend="Основание поиска"
name="basis"
options={[
{ value: "need", label: "По потребности" },
{ value: "all", label: "По всем профилям" },
]}
value="all"
onChange={() => undefined}
/>,
);
expect(html).toMatch(/<fieldset[^>]*><legend[^>]*>Основание поиска<\/legend>/);
expect(html.match(/type="radio"/g)).toHaveLength(2);
const inputs = [...html.matchAll(/<input[^>]*>/g)].map((match) => match[0]);
expect(inputs.find((input) => input.includes('value="all"'))).toContain('checked=""');
expect(inputs.find((input) => input.includes('value="need"'))).not.toContain("checked");
});
});
describe("Tag, AttentionDot, Skeleton", () => {
it("keeps tag text visible and the dot decorative", () => {
const html = renderToStaticMarkup(
<Tag tone="success" dot>
Грейд подтвержден
</Tag>,
);
expect(text(html)).toBe("Грейд подтвержден");
expect(html).toMatch(/data-tone="success"/);
expect(html).toMatch(/<span[^>]*aria-hidden="true"/);
});
it("gives the red dot a text alternative", () => {
expect(text(renderToStaticMarkup(<AttentionDot label="Новое" />))).toBe("Новое");
});
it("hides skeleton shapes from assistive technology", () => {
const html = renderToStaticMarkup(<Skeleton lines={2} shape="card" />);
expect(html).toMatch(/^<div[^>]*aria-hidden="true"/);
expect(text(html)).toBe("");
});
});
@@ -0,0 +1,80 @@
.root {
min-width: 0;
margin: 0;
padding: 0;
border: 0;
}
.legend {
margin-bottom: var(--space-2);
padding: 0;
font-weight: var(--font-weight-bold);
}
.legend-hidden {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
.track {
display: inline-flex;
flex-wrap: wrap;
gap: var(--space-1);
max-width: 100%;
padding: var(--space-1);
border: var(--line-thin) solid var(--color-border-strong);
border-radius: 1.5rem;
background: var(--color-surface);
}
.segment {
position: relative;
display: inline-flex;
}
/* The radio stays in the accessibility tree and takes focus; the label
* draws the capsule. */
.input {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
margin: 0;
opacity: 0;
cursor: pointer;
}
.label {
display: inline-flex;
align-items: center;
min-height: 2.5rem;
padding: var(--space-2) var(--space-4);
border-radius: var(--radius-pill);
color: var(--color-text-secondary);
font-family: var(--font-mono);
font-size: var(--font-size-s);
font-weight: var(--font-weight-medium);
white-space: nowrap;
transition:
background-color var(--duration-fast) var(--easing-standard),
color var(--duration-fast) var(--easing-standard);
}
.segment:hover .label {
color: var(--color-text);
background: var(--color-surface-tint-hover);
}
.input:checked + .label {
color: var(--color-on-inverse);
background: var(--color-inverse);
}
.input:focus-visible + .label {
outline: var(--focus-ring-width) solid var(--color-focus-ring);
outline-offset: var(--focus-ring-offset);
}
@@ -0,0 +1,53 @@
import styles from "./segmented-control.module.css";
export type SegmentedOption<TValue extends string> = {
value: TValue;
label: string;
};
type SegmentedControlProps<TValue extends string> = {
/** Visible group label; the fieldset legend. */
legend: string;
/** Hides the legend visually; it stays the accessible name. */
hideLegend?: boolean;
name: string;
options: readonly SegmentedOption<TValue>[];
/** Selected value; an empty string selects nothing. */
value: TValue | "";
onChange: (value: TValue) => void;
};
/**
* One choice out of a few, shown as a capsule track. It is a native radio
* group, so arrow keys, form semantics, and screen reader announcements come
* from the browser. The selected segment is inverted to paper.
*/
export function SegmentedControl<TValue extends string>({
legend,
hideLegend = false,
name,
options,
value,
onChange,
}: SegmentedControlProps<TValue>) {
return (
<fieldset className={styles.root}>
<legend className={hideLegend ? styles["legend-hidden"] : styles.legend}>{legend}</legend>
<div className={styles.track}>
{options.map((option) => (
<label key={option.value} className={styles.segment}>
<input
className={styles.input}
type="radio"
name={name}
value={option.value}
checked={option.value === value}
onChange={() => onChange(option.value)}
/>
<span className={styles.label}>{option.label}</span>
</label>
))}
</div>
</fieldset>
);
}
@@ -0,0 +1,54 @@
.root {
display: grid;
gap: var(--space-3);
}
.root[data-shape="card"] {
padding: var(--space-5);
border: var(--line-thin) solid var(--color-divider);
border-radius: var(--radius-m);
background: var(--color-surface);
}
.title,
.line {
display: block;
height: 0.75rem;
border-radius: var(--radius-pill);
background:
linear-gradient(90deg, transparent 0%, var(--color-surface-tint-hover) 50%, transparent 100%) 0
0 / 200% 100% no-repeat,
var(--color-surface-elevated);
animation: shimmer 1.6s linear infinite;
}
.title {
width: 40%;
height: 1.125rem;
margin-bottom: var(--space-2);
}
.line[data-last] {
width: 65%;
}
@keyframes shimmer {
from {
background-position:
150% 0,
0 0;
}
to {
background-position:
-50% 0,
0 0;
}
}
@media (prefers-reduced-motion: reduce) {
.title,
.line {
animation: none;
}
}
@@ -0,0 +1,23 @@
import styles from "./skeleton.module.css";
type SkeletonProps = {
/** Number of text lines; the last one is shorter. */
lines?: number;
/** "card" adds a title bar and a container around the lines. */
shape?: "lines" | "card";
};
/**
* Placeholder shapes while content loads. It is decoration only: pair it with
* LoadingState or another status message that announces the loading.
*/
export function Skeleton({ lines = 3, shape = "lines" }: SkeletonProps) {
return (
<div className={styles.root} data-shape={shape} aria-hidden="true">
{shape === "card" ? <span className={styles.title} /> : null}
{Array.from({ length: lines }, (_, index) => (
<span key={index} className={styles.line} data-last={index === lines - 1 || undefined} />
))}
</div>
);
}
@@ -3,20 +3,21 @@
z-index: 100;
top: var(--space-2);
left: var(--space-2);
padding: var(--space-3) var(--space-4);
border-radius: var(--radius-s);
color: var(--palette-white);
font-weight: var(--font-weight-bold);
padding: var(--space-3) var(--space-5);
border-radius: var(--radius-pill);
color: var(--color-on-action);
font-family: var(--font-mono);
font-size: var(--font-size-s);
font-weight: var(--font-weight-medium);
text-decoration: none;
background: var(--palette-violet);
background: var(--color-action);
transform: translateY(calc(-100% - var(--space-4)));
transition: transform var(--duration-fast) var(--easing-standard);
}
/* A white inner and graphite outer ring stay visible on light and dark headers. */
/* White on blue 6.84:1; the violet ring sits outside on the graphite canvas. */
.root:focus {
outline: var(--focus-ring-width) solid var(--palette-white);
outline-offset: 0;
box-shadow: 0 0 0 calc(var(--focus-ring-width) * 2) var(--palette-graphite);
outline: var(--focus-ring-width) solid var(--color-focus-ring);
outline-offset: var(--focus-ring-offset);
transform: translateY(0);
}
@@ -1,20 +1,58 @@
.root {
position: relative;
display: flex;
gap: var(--space-4);
align-items: flex-start;
padding: var(--space-5);
border: var(--line-thin) solid var(--color-divider);
border-radius: var(--radius-m);
overflow: hidden;
background: var(--color-surface);
}
/* Error blocks add a red edge; the triangle and the title carry meaning too. */
/* Error blocks get a red boundary and tint; the triangle and the title carry
* the meaning too. Signal red on the tinted surface stays above 4.5:1. */
.root[data-kind="error"] {
border-color: var(--color-danger);
box-shadow: inset var(--space-1) 0 0 var(--color-danger);
background:
linear-gradient(var(--color-danger-wash), var(--color-danger-wash)), var(--color-surface);
}
/* The empty box is a size container for its decor; the explicit width keeps
* it from collapsing in a shrink-to-fit parent. */
.root[data-kind="empty"] {
width: 100%;
min-height: 8.5rem;
container-type: inline-size;
border-style: dashed;
border-color: var(--color-border-hover);
background: transparent;
}
/* Circuit-trace decor of the empty state. It takes the right end of a wide
* box only, so it never runs under the text. */
.decor {
position: absolute;
right: var(--space-4);
bottom: 0;
display: none;
width: 13rem;
height: 100%;
opacity: 0.8;
}
@container (width >= 40rem) {
.decor {
display: block;
}
.root[data-kind="empty"] .content {
max-width: calc(100% - 15rem);
}
}
.mark {
position: relative;
flex: none;
width: 2.5rem;
height: 2.5rem;
@@ -38,12 +76,20 @@
.outline {
fill: none;
stroke: var(--color-text);
stroke-linecap: round;
stroke-linejoin: round;
stroke-width: 2;
}
.root[data-kind="empty"] .outline {
stroke-dasharray: 4 4;
.node {
fill: none;
stroke: var(--color-accent);
stroke-dasharray: 3 3;
stroke-width: 2;
}
.node-start {
fill: var(--color-text);
}
.danger {
@@ -53,22 +99,26 @@
stroke-width: 2;
}
/* Graphite glyph on signal red 5.61:1. */
.danger-glyph {
fill: none;
stroke: var(--palette-white);
stroke: var(--color-on-inverse);
stroke-linecap: round;
stroke-width: 3;
}
.content {
position: relative;
display: grid;
gap: var(--space-2);
min-width: 0;
}
.title {
font-size: var(--font-size-l);
font-weight: var(--font-weight-bold);
color: var(--color-text-strong);
font-family: var(--font-mono);
font-size: 1.0625rem;
font-weight: var(--font-weight-medium);
line-height: var(--line-height-snug);
}
@@ -86,18 +136,20 @@
.details summary {
width: fit-content;
border-radius: var(--radius-s);
border-radius: var(--radius-xs);
color: var(--color-link);
text-decoration: underline;
text-underline-offset: 0.2em;
cursor: pointer;
text-underline-offset: 0.22em;
}
.facts {
display: grid;
grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
gap: var(--space-1) var(--space-4);
padding-top: var(--space-3);
margin-top: var(--space-3);
padding: var(--space-3) var(--space-4);
border-radius: var(--radius-s);
background: var(--color-canvas);
}
.facts dt {
@@ -110,16 +162,38 @@
.saving {
min-height: 1.6em;
color: var(--color-text-secondary);
font-family: var(--font-mono);
font-size: var(--font-size-s);
}
.saving[data-state="saved"] {
color: var(--color-success);
}
.saving[data-state="saved"]::before,
.saving[data-state="saving"]::before {
display: inline-block;
width: 0.5rem;
height: 0.5rem;
margin-right: var(--space-2);
border-radius: 50%;
content: "";
background: currentcolor;
vertical-align: 0.1em;
}
.saving[data-state="failed"] {
color: var(--color-danger);
}
.saving[data-state="failed"]::before {
display: inline-block;
width: 0.6em;
height: 0.6em;
width: 0.55em;
height: 0.55em;
margin-right: var(--space-2);
content: "";
background: var(--color-danger);
background: currentcolor;
transform: rotate(45deg);
}
@@ -1,5 +1,6 @@
import type { ReactNode } from "react";
import { Button } from "../button/button";
import { CircuitTrace } from "../decor/circuit-trace";
import { Mono } from "../mono/mono";
import { describeError, isAccessDenied } from "./describe-error";
import styles from "./status-view.module.css";
@@ -24,7 +25,14 @@ function StatusMark({ kind }: { kind: StatusKind }) {
<path className={styles.spinner} d="M20 5a15 15 0 0 1 15 15" />
</>
) : null}
{kind === "empty" ? <circle className={styles.outline} cx="20" cy="20" r="15" /> : null}
{kind === "empty" ? (
<>
{/* A trace that ends at an open node: nothing is connected yet. */}
<path className={styles.outline} d="M4 30h10a6 6 0 0 0 6-6v-6" />
<circle className={styles.node} cx="20" cy="13" r="5" />
<circle className={styles["node-start"]} cx="4" cy="30" r="2.5" />
</>
) : null}
{kind === "error" ? (
<>
<path className={styles.danger} d="M20 4 37 34H3Z" />
@@ -33,7 +41,7 @@ function StatusMark({ kind }: { kind: StatusKind }) {
) : null}
{kind === "forbidden" ? (
<>
<rect className={styles.outline} x="8" y="17" width="24" height="18" rx="3" />
<rect className={styles.outline} x="8" y="17" width="24" height="18" rx="6" />
<path className={styles.outline} d="M13 17v-4a7 7 0 0 1 14 0v4" />
</>
) : null}
@@ -54,6 +62,7 @@ export function StatusView({ kind, title, description, action, children }: Statu
role={kind === "error" ? "alert" : "status"}
aria-busy={kind === "loading" || undefined}
>
{kind === "empty" ? <CircuitTrace className={styles.decor} /> : null}
<StatusMark kind={kind} />
<div className={styles.content}>
<p className={styles.title}>{title}</p>
@@ -0,0 +1,22 @@
export type StepStatus = "complete" | "current" | "upcoming";
export type StepperStep = {
id: string;
label: string;
status: StepStatus;
};
/**
* Builds the statuses of a linear flow: steps before the current one are
* complete, the rest are upcoming. A current index past the end marks every
* step complete.
*/
export function buildSteps(
steps: readonly { id: string; label: string }[],
currentIndex: number,
): StepperStep[] {
return steps.map((step, index) => ({
...step,
status: index < currentIndex ? "complete" : index === currentIndex ? "current" : "upcoming",
}));
}
@@ -0,0 +1,89 @@
.root {
display: grid;
gap: var(--space-3);
min-width: 0;
}
.summary {
color: var(--color-text-secondary);
font-family: var(--font-mono);
font-size: var(--font-size-xs);
font-weight: var(--font-weight-medium);
letter-spacing: var(--letter-spacing-label);
text-transform: uppercase;
}
/* Steps sit in a row joined by a hairline trace; a completed segment lights
* up in the readable accent. On a phone the labels wrap under the markers. */
.list {
display: grid;
grid-auto-columns: minmax(0, 1fr);
grid-auto-flow: column;
margin: 0;
padding: 0;
list-style: none;
}
.step {
position: relative;
display: grid;
gap: var(--space-2);
align-content: start;
justify-items: start;
min-width: 0;
padding-right: var(--space-2);
}
/* Trace from this marker to the next one. */
.step:not(:last-child)::after {
position: absolute;
top: 0.875rem;
right: 0;
left: 2rem;
height: var(--line-thin);
content: "";
background: var(--color-divider);
}
.step[data-status="complete"]:not(:last-child)::after {
background: var(--color-accent);
}
.marker {
display: inline-grid;
place-items: center;
width: 1.75rem;
height: 1.75rem;
border: var(--line-thin) solid var(--color-border-strong);
border-radius: 50%;
color: var(--color-text-secondary);
font-family: var(--font-mono);
font-size: var(--font-size-xs);
font-weight: var(--font-weight-medium);
background: var(--color-canvas);
}
.step[data-status="complete"] .marker {
border-color: var(--color-accent);
color: var(--color-on-accent);
background: var(--color-accent);
}
/* The current step is inverted: paper with graphite, "you are here". */
.step[data-status="current"] .marker {
border-color: var(--color-inverse);
color: var(--color-on-inverse);
background: var(--color-inverse);
}
.label {
color: var(--color-text-secondary);
font-size: var(--font-size-s);
line-height: var(--line-height-snug);
overflow-wrap: anywhere;
}
.step[data-status="current"] .label {
color: var(--color-text-strong);
font-weight: var(--font-weight-bold);
}
@@ -0,0 +1,55 @@
import { VisuallyHidden } from "../visually-hidden/visually-hidden";
import styles from "./stepper.module.css";
import type { StepStatus, StepperStep } from "./build-steps";
const statusText: Readonly<Record<StepStatus, string>> = {
complete: "выполнен",
current: "текущий шаг",
upcoming: "впереди",
};
type StepperProps = {
/** Accessible name of the step list, for example "Шаги регистрации". */
label: string;
steps: readonly StepperStep[];
};
/**
* Progress through a multi-step flow: a visible "step N of M" line and an
* ordered list joined by a trace. The current step has aria-current="step";
* each step states its status in text, so the shape and color only repeat it.
*/
export function Stepper({ label, steps }: StepperProps) {
const currentIndex = steps.findIndex((step) => step.status === "current");
const completed = steps.filter((step) => step.status === "complete").length;
const position = currentIndex === -1 ? completed : currentIndex + 1;
return (
<div className={styles.root}>
<p className={styles.summary}>
{currentIndex === -1 && completed === steps.length
? `Все шаги выполнены: ${steps.length} из ${steps.length}`
: `Шаг ${position} из ${steps.length}`}
</p>
<ol className={styles.list} aria-label={label}>
{steps.map((step, index) => (
<li
key={step.id}
className={styles.step}
data-status={step.status}
aria-current={step.status === "current" ? "step" : undefined}
>
<span className={styles.marker} aria-hidden="true">
{step.status === "complete" ? "✓" : index + 1}
</span>
<span className={styles.label}>
{step.label}
<VisuallyHidden>{`, ${statusText[step.status]}`}</VisuallyHidden>
</span>
</li>
))}
</ol>
</div>
);
}
+20
View File
@@ -0,0 +1,20 @@
/**
* Index of the tab that a key moves focus to in a horizontal tab list, or
* null when the key is not a tab-list key. Arrows wrap around; Home and End
* jump to the ends (WAI-ARIA Authoring Practices, tabs pattern).
*/
export function tabKeyTarget(key: string, index: number, count: number): number | null {
if (count <= 0) return null;
switch (key) {
case "ArrowRight":
return (index + 1) % count;
case "ArrowLeft":
return (index - 1 + count) % count;
case "Home":
return 0;
case "End":
return count - 1;
default:
return null;
}
}
@@ -0,0 +1,56 @@
.root {
display: grid;
gap: var(--space-4);
min-width: 0;
}
/* A capsule track of pill tabs; it scrolls sideways on a phone. */
.list {
display: flex;
gap: var(--space-1);
width: fit-content;
max-width: 100%;
padding: var(--space-1);
border: var(--line-thin) solid var(--color-divider);
border-radius: var(--radius-pill);
overflow-x: auto;
background: var(--color-surface);
scrollbar-width: none;
}
.tab {
flex: none;
min-height: 2.5rem;
padding: var(--space-2) var(--space-4);
border: 0;
border-radius: var(--radius-pill);
color: var(--color-text-secondary);
font-family: var(--font-mono);
font-size: var(--font-size-s);
font-weight: var(--font-weight-medium);
white-space: nowrap;
cursor: pointer;
background: transparent;
transition:
background-color var(--duration-fast) var(--easing-standard),
color var(--duration-fast) var(--easing-standard);
}
.tab:hover {
color: var(--color-text);
background: var(--color-surface-tint-hover);
}
/* Selected tab: inverted paper capsule, graphite text 14.53:1. */
.tab[aria-selected="true"] {
color: var(--color-on-inverse);
background: var(--color-inverse);
}
.tab:focus-visible {
outline-offset: -2px;
}
.panel:focus-visible {
border-radius: var(--radius-s);
}
+88
View File
@@ -0,0 +1,88 @@
import { useId, useRef, useState, type KeyboardEvent, type ReactNode } from "react";
import { tabKeyTarget } from "./tab-keys";
import styles from "./tabs.module.css";
export type TabItem = {
id: string;
label: string;
content: ReactNode;
};
type TabsProps = {
/** Accessible name of the tab list. */
label: string;
items: readonly TabItem[];
/** Controlled selection; omit to let the component keep it. */
value?: string | undefined;
defaultValue?: string | undefined;
onChange?: ((id: string) => void) | undefined;
};
/**
* Tabs (WAI-ARIA tabs pattern with automatic activation). Only the selected
* tab is in the tab order; arrow keys, Home, and End move between tabs.
* Inactive panels stay mounted with the hidden attribute, so form state in a
* panel survives switching tabs.
*/
export function Tabs({ label, items, value, defaultValue, onChange }: TabsProps) {
const baseId = useId();
const [ownValue, setOwnValue] = useState(defaultValue ?? items[0]?.id);
const selected = value ?? ownValue;
const tabRefs = useRef<(HTMLButtonElement | null)[]>([]);
function select(id: string) {
if (value === undefined) setOwnValue(id);
onChange?.(id);
}
function handleKeyDown(event: KeyboardEvent<HTMLButtonElement>, index: number) {
const target = tabKeyTarget(event.key, index, items.length);
const item = target === null ? undefined : items[target];
if (target === null || !item) return;
event.preventDefault();
select(item.id);
tabRefs.current[target]?.focus();
}
return (
<div className={styles.root}>
<div className={styles.list} role="tablist" aria-label={label}>
{items.map((item, index) => {
const isSelected = item.id === selected;
return (
<button
key={item.id}
ref={(element) => {
tabRefs.current[index] = element;
}}
type="button"
role="tab"
id={`${baseId}-tab-${item.id}`}
className={styles.tab}
aria-selected={isSelected}
aria-controls={`${baseId}-panel-${item.id}`}
tabIndex={isSelected ? 0 : -1}
onClick={() => select(item.id)}
onKeyDown={(event) => handleKeyDown(event, index)}
>
{item.label}
</button>
);
})}
</div>
{items.map((item) => (
<div
key={item.id}
role="tabpanel"
id={`${baseId}-panel-${item.id}`}
className={styles.panel}
aria-labelledby={`${baseId}-tab-${item.id}`}
hidden={item.id !== selected}
tabIndex={0}
>
{item.content}
</div>
))}
</div>
);
}
+66
View File
@@ -0,0 +1,66 @@
/* Contrast after the tint is laid over the surface #202129 is listed in
* frontend/README.en.md; every tone stays above 4.5:1. */
.root {
display: inline-flex;
gap: 0.375rem;
align-items: center;
min-height: 1.5rem;
padding: 0.125rem 0.625rem;
border-radius: var(--radius-pill);
color: var(--color-text-secondary);
font-size: 0.75rem;
font-weight: var(--font-weight-medium);
line-height: 1.4;
white-space: nowrap;
background: var(--color-surface-tint);
}
.root[data-tone="grade"],
.root[data-tone="stack"] {
color: var(--color-text);
font-family: var(--font-mono);
font-variant-ligatures: none;
}
.root[data-tone="grade"] {
letter-spacing: 0.04em;
text-transform: uppercase;
background: var(--color-surface-elevated);
}
.root[data-tone="stack"] {
background: var(--color-surface-tint-hover);
}
.root[data-tone="accent"] {
color: var(--color-accent);
background: var(--color-accent-tint);
}
.root[data-tone="success"] {
color: var(--color-success);
background: var(--color-success-tint);
}
.root[data-tone="danger"] {
color: var(--color-danger);
background: var(--color-danger-tint);
}
.dot {
flex: none;
width: 0.375rem;
height: 0.375rem;
border-radius: 50%;
background: currentcolor;
}
.attention {
display: inline-block;
flex: none;
width: 0.5rem;
height: 0.5rem;
border-radius: 50%;
background: var(--color-attention);
vertical-align: 0.1em;
}
+45
View File
@@ -0,0 +1,45 @@
import type { ReactNode } from "react";
import { VisuallyHidden } from "../visually-hidden/visually-hidden";
import styles from "./tag.module.css";
/**
* neutral - meta label; grade - category such as BACKEND · MIDDLE (mono caps);
* stack - technology; accent - a match or a highlighted fact; success and
* danger - outcomes. The text always states the meaning; the tone repeats it.
*/
export type TagTone = "neutral" | "grade" | "stack" | "accent" | "success" | "danger";
type TagProps = {
tone?: TagTone;
/** A 6px dot before the text in the tag's own color. */
dot?: boolean;
children: ReactNode;
};
/** Capsule label for grades, stack, statuses, and meta. */
export function Tag({ tone = "neutral", dot = false, children }: TagProps) {
return (
<span className={styles.root} data-tone={tone}>
{dot ? <span className={styles.dot} aria-hidden="true" /> : null}
{children}
</span>
);
}
type AttentionDotProps = {
/** Text for assistive technology, for example "Новое". */
label: string;
};
/**
* The red 8px dot of the design system: "new", "live", "unread". Red never
* carries text, so the meaning is given to assistive technology as text and
* should also be visible nearby in words.
*/
export function AttentionDot({ label }: AttentionDotProps) {
return (
<span className={styles.attention}>
<VisuallyHidden>{label}</VisuallyHidden>
</span>
);
}
+20 -8
View File
@@ -1,20 +1,32 @@
/*
* JetBrains Mono 2.304, SIL Open Font License 1.1.
* The license and authors list are next to the font files in ./fonts/.
* Only the regular and bold weights are shipped; no external font CDN.
* Self-hosted fonts, SIL Open Font License 1.1. Licenses, authors, sources,
* and subset ranges are listed in ./fonts/SOURCES.txt. No external font CDN:
* the CSP allows fonts from the same origin only.
*
* Inter - paragraphs, meta, form text (variable weight 400-700).
* JetBrains - headings, labels, buttons, numbers, grades, stack, codes.
* Unbounded - the Lincodex wordmark only (Latin subset).
*/
@font-face {
font-family: "JetBrains Mono";
font-family: Inter;
font-style: normal;
font-weight: 400;
font-weight: 400 700;
font-display: swap;
src: url("./fonts/JetBrainsMono-Regular.woff2") format("woff2");
src: url("./fonts/Inter-Variable.woff2") format("woff2");
}
@font-face {
font-family: "JetBrains Mono";
font-style: normal;
font-weight: 700;
font-weight: 400 700;
font-display: swap;
src: url("./fonts/JetBrainsMono-Bold.woff2") format("woff2");
src: url("./fonts/JetBrainsMono-Variable.woff2") format("woff2");
}
@font-face {
font-family: Unbounded;
font-style: normal;
font-weight: 500 800;
font-display: block;
src: url("./fonts/Unbounded-Variable.woff2") format("woff2");
}
@@ -0,0 +1,93 @@
Copyright 2020 The Inter Project Authors (https://github.com/rsms/inter)
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,31 @@
Font files served by the frontend. All three families are licensed under the
SIL Open Font License 1.1 (see the *-OFL.txt file of each family). None of the
licenses declares a Reserved Font Name, so the subset files keep the family
names. The files are subsets made with fontTools (varLib.instancer and
pyftsubset) and are served from the same origin (CSP font-src 'self').
JetBrainsMono-Variable.woff2
Family: JetBrains Mono 2.304, Philipp Nurullin and Konstantin Bulenkov (JetBrains).
Source: JetBrainsMono-2.304.zip, fonts/variable/JetBrainsMono[wght].ttf
(https://github.com/JetBrains/JetBrainsMono, release v2.304).
Instance: wght 400-700.
License and authors: JetBrainsMono-OFL.txt, JetBrainsMono-AUTHORS.txt.
Inter-Variable.woff2
Family: Inter 4.001, Rasmus Andersson and The Inter Project Authors.
Source: https://github.com/google/fonts, ofl/inter/Inter[opsz,wght].ttf
(commit 0b58fb370093f9a9f4ff785d94405710b79de67c; upstream https://github.com/rsms/inter).
Instance: opsz pinned to 14, wght 400-700.
License and authors: Inter-OFL.txt (the copyright line names the authors).
Unbounded-Variable.woff2
Family: Unbounded 1.701, NaN (Luke Prowse, Jean-Baptiste Morizot, Fatima Lazaro, Florian Runge).
Source: https://github.com/google/fonts, ofl/unbounded/Unbounded[wght].ttf
(commit 8b0a1d0f5983c89bc2b93f1b5fb55f9e252744b5; upstream https://github.com/googlefonts/unbounded).
Instance: wght 500-800, printable ASCII only. Used only for the Lincodex wordmark.
License and authors: Unbounded-OFL.txt (the copyright line names the authors).
Character set of JetBrains Mono and Inter: Basic Latin, Latin-1, Greek,
basic Cyrillic with Ukrainian and Kazakh additions, general punctuation, the
ruble and numero signs, arrows, common math operators, box drawing, block
elements, geometric shapes, check marks, and keyboard symbols.
@@ -0,0 +1,93 @@
Copyright 2022 The Unbounded Project Authors (https://github.com/googlefonts/unbounded)
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
+121 -50
View File
@@ -1,68 +1,118 @@
/*
* Design tokens of the Lincodex interface.
* Design tokens of the Lincodex interface: the dark graphite system from
* docs/other/design/DESIGN.md. Dark is the default and the only theme.
*
* Palette values come from the product requirements (section 5). Only the
* light theme exists: dark surfaces are local regions (for example the
* employer header) that override the text, link, and focus tokens with
* checked pairs. A dark theme must define and check its own pairs instead of
* inheriting the light accents. See frontend/README.en.md for the contrast
* table of every text and background pair in use.
* Contrast rules (every pair is listed in frontend/README.en.md):
* - Text tokens reach 4.5:1 on canvas and surface. --color-text-muted and
* --color-danger are for canvas and surface only (they drop below 4.5:1 on
* the elevated surface).
* - The action blue #402fff never carries text on graphite (2.49:1). Text,
* rings, strokes, and selected markers use --color-accent (#9a92ff).
* - Signal red --color-attention is for 6-8px dots only.
* - --color-divider is a decorative hairline. A control whose boundary
* identifies it uses --color-border-strong (3:1 on canvas and surface).
*
* Breakpoints cannot be custom properties inside media queries, so they are
* fixed values used directly by components:
* 360px - smallest supported width (body min-width: 20rem)
* 700px - phone layout ends: (width >= 43.75rem)
* 768px - tablet: (width >= 48rem)
* 1024px - desktop navigation: (width >= 64rem)
* 1280px - wide desktop, verified layout width
*/
:root {
/* Brand palette. Use the semantic tokens below in components. */
--palette-violet: #402fff;
--palette-red: #ec1d35;
color-scheme: dark;
/* Palette. Components use the semantic tokens below. */
--palette-graphite: #1b1c21;
--palette-graphite-soft: #2d2e37;
--palette-light: #ededed;
--palette-grey: #c8c9ca;
--palette-graphite-raised: #202129;
--palette-graphite-elevated: #2d2e37;
--palette-graphite-line: #414246;
--palette-graphite-edge: #73757f;
--palette-paper: #ededed;
--palette-silver: #c8c9ca;
--palette-white: #fff;
--palette-steel: #9b9c9e;
--palette-slate: #878994;
--palette-blue: #402fff;
--palette-blue-pressed: #3324e0;
--palette-violet: #9a92ff;
--palette-red: #ec1d35;
--palette-signal-red: #ff5a6a;
--palette-green: #3ccf7e;
/* Semantic colors for the light theme. */
--color-canvas: var(--palette-light);
--color-surface: var(--palette-white);
--color-text: var(--palette-graphite);
--color-text-secondary: var(--palette-graphite-soft);
/* Surfaces: depth comes from steps and hairlines, not from shadows. */
--color-canvas: var(--palette-graphite);
--color-surface: var(--palette-graphite-raised);
--color-surface-elevated: var(--palette-graphite-elevated);
--color-surface-hover: var(--palette-graphite-line);
--color-surface-tint: rgb(237 237 237 / 6%);
--color-surface-tint-hover: rgb(237 237 237 / 10%);
--color-inverse: var(--palette-paper);
--color-on-inverse: var(--palette-graphite);
/* Text. */
--color-text: var(--palette-paper);
--color-text-strong: var(--palette-white);
--color-text-secondary: var(--palette-steel);
--color-text-muted: var(--palette-slate);
/* The single action color: primary buttons and active filters. Hover
* inverts the button to paper with blue text. */
--color-action: var(--palette-blue);
--color-action-pressed: var(--palette-blue-pressed);
--color-on-action: var(--palette-white);
--color-action-hover: var(--palette-paper);
--color-on-action-hover: var(--palette-blue);
/* Readable accent of the action color: text, rings, strokes, stripes,
* selected markers. --color-on-accent is text on an accent fill. */
--color-accent: var(--palette-violet);
--color-on-accent: var(--palette-white);
--color-on-accent: var(--palette-graphite);
--color-link: var(--palette-violet);
--color-link-hover: var(--palette-paper);
/* Red is reserved for errors and problems. It reaches only 4.38:1 on white,
* so it marks error graphics (borders, icons) and never carries body text. */
--color-danger: var(--palette-red);
/* States. Danger text is the lightened red; the brand red is a dot. */
--color-danger: var(--palette-signal-red);
--color-danger-tint: rgb(236 29 53 / 16%);
--color-danger-wash: rgb(236 29 53 / 8%);
--color-success: var(--palette-green);
--color-success-tint: rgb(60 207 126 / 14%);
--color-attention: var(--palette-red);
--color-accent-tint: rgb(64 47 255 / 18%);
/* Decorative dividers only: grey does not reach 3:1 and must not be the
* only boundary of an interactive control. */
--color-divider: var(--palette-grey);
--color-border-strong: var(--palette-graphite);
/* Lines. */
--color-divider: var(--palette-graphite-elevated);
--color-border-hover: var(--palette-graphite-line);
--color-border-strong: var(--palette-graphite-edge);
--color-focus-ring: var(--palette-violet);
/* Typography. Text uses the system stack; JetBrains Mono is self-hosted for
* numbers, scores, codes, and pseudonyms. */
--font-text:
ui-sans-serif, system-ui, -apple-system, "Segoe UI", roboto, "Helvetica Neue", arial, sans-serif;
/* Circuit-trace decor: silver at half opacity, as in the design system. */
--color-trace: rgb(200 201 202 / 50%);
/* The only shadow: popovers, menus, and dialogs. */
--shadow-popover: 0 16px 40px rgb(0 0 0 / 45%);
/* Typography. Inter for paragraphs and meta, JetBrains Mono for headings,
* labels, buttons, numbers, grades, and stack, Unbounded for the wordmark. */
--font-text: inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", roboto, sans-serif;
--font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", menlo, consolas, monospace;
--font-display: unbounded, var(--font-text);
--font-size-xs: 0.8125rem;
--font-size-s: 0.9375rem;
--font-size-m: 1.0625rem;
--font-size-s: 0.875rem;
--font-size-m: 1rem;
--font-size-l: 1.25rem;
--font-size-xl: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
--font-size-display: clamp(2rem, 1.45rem + 2.4vw, 3.25rem);
--font-size-xl: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
--font-size-title: clamp(1.625rem, 1.45rem + 0.8vw, 2rem);
--font-size-display: clamp(2rem, 1.3rem + 3vw, 3.375rem);
--font-weight-regular: 400;
--font-weight-medium: 500;
--font-weight-bold: 700;
--line-height-tight: 1.1;
--font-weight-bold: 600;
--line-height-tight: 1.15;
--line-height-snug: 1.3;
--line-height-body: 1.6;
--letter-spacing-display: -0.03em;
--letter-spacing-label: 0.08em;
--letter-spacing-display: -0.02em;
--letter-spacing-label: 0.06em;
/* Spacing scale with a 4px base. */
--space-1: 0.25rem;
@@ -75,29 +125,43 @@
--space-8: 4rem;
--space-9: 6rem;
/* Radii follow the rounded corners of the brand connector lines. */
--radius-s: 0.375rem;
--radius-m: 0.75rem;
--radius-l: 1.25rem;
/* Radii, one rule per element type: controls and tags are capsules,
* containers 24, panels 32, surfaces nested in a card 16, objects up to
* 24px (checkboxes, keycaps) 6. */
--radius-xs: 0.375rem;
--radius-s: 1rem;
--radius-m: 1.5rem;
--radius-l: 2rem;
--radius-pill: 999px;
/* Lines. */
/* Lines: hairlines everywhere, the strong line for state stripes. */
--line-thin: 1px;
--line-strong: 2px;
/* Focus indicator: 3px ring outside the element. */
--focus-ring-width: 3px;
/* Focus indicator: 2px violet ring outside the element. */
--focus-ring-width: 2px;
--focus-ring-offset: 2px;
/* Layout widths. */
/* Layout. */
--content-width-narrow: 40rem;
--content-width-wide: 80rem;
--content-width-wide: 77.5rem;
--gutter: var(--space-4);
--chrome-inset: 0.625rem;
--header-height: 3.5rem;
--control-height: 2.75rem;
/* Motion. Reduced motion collapses durations below. */
--duration-fast: 120ms;
--duration-base: 220ms;
--easing-standard: cubic-bezier(0.2, 0, 0, 1);
--duration-fast: 150ms;
--duration-base: 200ms;
--duration-slow: 400ms;
--easing-standard: cubic-bezier(0.25, 0.1, 0.25, 1);
--easing-emphasized: cubic-bezier(0.4, 0.24, 0, 1);
}
@media (width >= 43.75rem) {
:root {
--header-height: 4rem;
}
}
@media (width >= 48rem) {
@@ -106,9 +170,16 @@
}
}
@media (width >= 80rem) {
:root {
--gutter: 2.5rem;
}
}
@media (prefers-reduced-motion: reduce) {
:root {
--duration-fast: 0ms;
--duration-base: 0ms;
--duration-slow: 0ms;
}
}
@@ -12,7 +12,7 @@
height: 1.25rem;
}
/* Graphics need 3:1: graphite 17.01:1 and violet 6.84:1 on white. */
/* Graphics need 3:1: paper 13.68:1 and violet 6.05:1 on the surface. */
.empty {
fill: none;
stroke: var(--color-text);
@@ -1,52 +1,102 @@
/* Mobile first: base rules target 360px; wider screens add layout. */
.shell {
--tab-bar-height: 4rem;
min-height: 100vh;
}
.header {
position: sticky;
z-index: 10;
z-index: 20;
top: 0;
display: grid;
gap: var(--space-1);
padding: var(--space-2) var(--gutter) 0;
border-bottom: var(--line-thin) solid var(--color-divider);
background: var(--color-surface);
}
/* The strip scrolls sideways; padding keeps focus rings inside the clip. */
/* Phone: the tab strip is a bar fixed to the bottom edge. It scrolls
* sideways; the current tab is scrolled into the middle by the shell. */
.nav {
margin-inline: calc(-1 * var(--gutter));
overflow-x: auto;
overscroll-behavior-x: contain;
scrollbar-width: thin;
position: fixed;
z-index: 20;
right: 0;
bottom: 0;
left: 0;
border-top: var(--line-thin) solid var(--color-divider);
background: rgb(27 28 33 / 92%);
backdrop-filter: blur(14px) saturate(140%);
}
.list {
display: flex;
gap: var(--space-1);
width: max-content;
min-height: var(--tab-bar-height);
margin: 0;
padding: var(--space-1) var(--gutter) var(--space-2);
padding: var(--space-2) var(--space-3) calc(var(--space-2) + env(safe-area-inset-bottom));
overflow-x: auto;
overscroll-behavior-x: contain;
list-style: none;
scroll-snap-type: x proximity;
scrollbar-width: none;
}
@media (width >= 64rem) {
.header {
grid-template-columns: auto 1fr;
gap: var(--space-6);
align-items: center;
padding-block: var(--space-2);
.list li {
display: flex;
align-items: center;
scroll-snap-align: center;
}
/* Room for the bottom bar, so the end of a page is never under it. */
.main {
padding-bottom: calc(var(--tab-bar-height) + env(safe-area-inset-bottom));
}
/* A blurred plate would become the containing block of the fixed bar, so
* the phone plate is solid. */
@media (width < 43.75rem) {
.plate {
background: var(--color-surface);
backdrop-filter: none;
}
}
/* Tablet: the tabs move into the plate, under the wordmark. */
@media (width >= 43.75rem) {
.plate {
flex-wrap: wrap;
row-gap: 0;
}
.nav {
margin-inline: 0;
overflow-x: visible;
position: static;
flex: 1 1 100%;
min-width: 0;
margin-inline: calc(-1 * var(--space-2));
border-top: var(--line-thin) solid var(--color-divider);
background: none;
backdrop-filter: none;
}
.list {
min-height: auto;
padding: var(--space-2) var(--space-1);
}
.main {
padding-bottom: 0;
}
}
/* Desktop: one row, the tabs to the right of the wordmark. */
@media (width >= 64rem) {
.plate {
flex-wrap: nowrap;
}
.nav {
flex: 0 1 auto;
margin-inline: 0;
border-top: 0;
}
.list {
justify-content: flex-end;
width: auto;
padding: 0;
}
}
@@ -1,6 +1,7 @@
import { Outlet } from "react-router-dom";
import { useEffect, useRef } from "react";
import { Outlet, useLocation } from "react-router-dom";
import { paths } from "../../../shared/config";
import { BrandLogo, MainRegion, NavItem, SkipLink } from "../../../shared/ui";
import { HeaderPlate, MainRegion, NavItem, SkipLink, Wordmark } from "../../../shared/ui";
import styles from "./candidate-shell.module.css";
const navigation = [
@@ -16,28 +17,53 @@ const navigation = [
] as const;
/**
* Candidate cabinet layout, designed for phones first: a compact header and
* a horizontally scrollable section strip that becomes one row on desktop.
* Keeps the current section visible in a horizontally scrolling tab strip.
* Only the strip scrolls; the page does not move.
*/
function useCurrentTabInView() {
const listRef = useRef<HTMLUListElement>(null);
const { pathname } = useLocation();
useEffect(() => {
const list = listRef.current;
const current = list?.querySelector<HTMLElement>('[aria-current="page"]');
if (!list || !current || list.scrollWidth <= list.clientWidth) return;
const left = current.offsetLeft - (list.clientWidth - current.offsetWidth) / 2;
list.scrollLeft = Math.max(0, left);
}, [pathname]);
return listRef;
}
/**
* Candidate cabinet layout, designed for phones first. On a phone the
* section tabs form a bar at the bottom of the screen, within thumb reach;
* from 700px they sit in the header plate. The navigation comes before main
* in the document, so the keyboard order is the same at every width.
*/
export function CandidateShell() {
const listRef = useCurrentTabInView();
return (
<div className={styles.shell}>
<SkipLink />
<header className={styles.header}>
<BrandLogo to={paths.candidate.root} context="Кабинет кандидата" />
<nav className={styles.nav} aria-label="Разделы кабинета кандидата">
<ul className={styles.list}>
{navigation.map((item) => (
<li key={item.to}>
<NavItem to={item.to} end={item.end}>
{item.label}
</NavItem>
</li>
))}
</ul>
</nav>
<HeaderPlate className={styles.plate}>
<Wordmark to={paths.candidate.root} context="Кабинет кандидата" />
<nav className={styles.nav} aria-label="Разделы кабинета кандидата">
<ul ref={listRef} className={styles.list}>
{navigation.map((item) => (
<li key={item.to}>
<NavItem to={item.to} end={item.end}>
{item.label}
</NavItem>
</li>
))}
</ul>
</nav>
</HeaderPlate>
</header>
<MainRegion>
<MainRegion className={styles.main}>
<Outlet />
</MainRegion>
</div>
@@ -1,18 +1,32 @@
/* A slim strip above the header: the red dot is the design system's "live"
* marker; the bold label states the meaning in words. */
.banner {
padding: var(--space-2) var(--space-4);
border-bottom: var(--line-strong) solid var(--color-border-strong);
color: var(--color-text);
padding: var(--space-2) var(--gutter);
border-bottom: var(--line-thin) solid var(--color-divider);
color: var(--color-text-secondary);
font-size: var(--font-size-xs);
line-height: var(--line-height-snug);
background: var(--color-surface);
font-size: var(--font-size-s);
}
.banner p {
margin: 0;
max-width: 80rem;
margin-inline: auto;
max-width: var(--content-width-wide);
margin: 0 auto;
}
.label {
color: var(--color-accent);
font-weight: var(--font-weight-bold);
color: var(--color-text-strong);
font-family: var(--font-mono);
font-weight: var(--font-weight-medium);
}
.label::before {
display: inline-block;
width: 0.5rem;
height: 0.5rem;
margin-right: var(--space-2);
border-radius: 50%;
content: "";
background: var(--color-attention);
vertical-align: 0.05em;
}
@@ -1,35 +1,81 @@
/* Desktop first: base rules target 1024px and wider; narrow screens adapt. */
/* The graphite rail is painted by the container, not by the sidebar alone:
* the sidebar is sticky and only one viewport tall, while the container spans
* the whole page, so the rail stays dark on long pages. */
/* Narrow first: below 1024px the sidebar is a sticky header plate. */
.shell {
display: grid;
grid-template-columns: 17rem minmax(0, 1fr);
grid-template-rows: auto 1fr;
min-height: 100vh;
background: linear-gradient(var(--palette-graphite), var(--palette-graphite)) left top / 17rem
100% no-repeat;
}
/* Dark region: violet fails on graphite (2.49:1), so text, links, and the
* focus ring switch to checked light values here. */
.sidebar {
--color-focus-ring: var(--palette-white);
position: sticky;
top: 0;
z-index: 20;
top: var(--chrome-inset);
margin: var(--chrome-inset) var(--chrome-inset) 0;
border: var(--line-thin) solid var(--color-divider);
border-radius: var(--radius-m);
background: var(--color-surface);
}
.top {
display: flex;
flex-direction: column;
gap: var(--space-6);
height: 100vh;
padding: var(--space-4) var(--space-4) var(--space-6);
color: var(--palette-light);
background: var(--palette-graphite);
gap: var(--space-3);
align-items: center;
justify-content: space-between;
min-height: var(--header-height);
padding: var(--space-1) var(--space-2) var(--space-1) var(--space-4);
}
.brand {
display: flex;
gap: var(--space-3);
align-items: center;
min-width: 0;
}
/* Cabinet name: a mono label, steel on the surface 5.83:1. */
.context {
padding-left: var(--space-3);
border-left: var(--line-thin) solid var(--color-divider);
color: var(--color-text-secondary);
font-family: var(--font-mono);
font-size: var(--font-size-xs);
font-weight: var(--font-weight-medium);
line-height: var(--line-height-snug);
}
/* On a phone the cabinet name stacks under the wordmark. */
@media (width < 30rem) {
.brand {
flex-direction: column;
gap: 0;
align-items: flex-start;
}
.brand .context {
padding-left: 0;
border-left: 0;
}
.brand a {
min-height: 2rem;
}
}
.nav {
border-top: var(--line-thin) solid var(--palette-graphite-soft);
padding-top: var(--space-4);
position: absolute;
top: calc(100% + var(--space-2));
right: 0;
left: 0;
display: none;
padding: var(--space-2);
border: var(--line-thin) solid var(--color-border-hover);
border-radius: var(--radius-m);
background: var(--color-surface-elevated);
box-shadow: var(--shadow-popover);
}
.nav[data-open] {
display: block;
animation: drop var(--duration-base) var(--easing-emphasized);
}
.list {
@@ -40,44 +86,69 @@
list-style: none;
}
.list a {
width: 100%;
}
.main {
min-width: 0;
}
@media (width < 64rem) {
/* Desktop: a floating 240px rail beside the work area. The cabinet name
* stacks under the wordmark. */
@media (width >= 64rem) {
.shell {
grid-template-columns: minmax(0, 1fr);
grid-template-rows: auto 1fr;
background: none;
grid-template-columns: 15rem minmax(0, 1fr);
grid-template-rows: none;
column-gap: var(--space-2);
}
.sidebar {
z-index: 10;
gap: var(--space-1);
height: auto;
padding: var(--space-2) var(--gutter) 0;
}
.nav {
margin-inline: calc(-1 * var(--gutter));
padding-top: 0;
border-top: 0;
overflow-x: auto;
overscroll-behavior-x: contain;
scrollbar-width: thin;
}
.list {
display: flex;
width: max-content;
padding: var(--space-1) var(--gutter) var(--space-2);
flex-direction: column;
gap: var(--space-5);
align-self: start;
height: calc(100vh - 2 * var(--chrome-inset));
margin: var(--chrome-inset) 0 var(--chrome-inset) var(--chrome-inset);
padding: var(--space-4) var(--space-3);
}
.list a {
width: auto;
.top {
display: grid;
gap: var(--space-2);
justify-items: start;
min-height: 0;
padding: 0 var(--space-2);
}
.brand {
flex-direction: column;
gap: 0;
align-items: flex-start;
}
.context {
padding-left: 0;
border-left: 0;
}
.toggle {
display: none;
}
.nav,
.nav[data-open] {
position: static;
display: block;
padding: var(--space-4) 0 0;
border: 0;
border-top: var(--line-thin) solid var(--color-divider);
border-radius: 0;
background: none;
box-shadow: none;
animation: none;
}
}
@keyframes drop {
from {
opacity: 0;
transform: translateY(-4px);
}
}
@@ -1,6 +1,13 @@
import { Outlet } from "react-router-dom";
import { paths } from "../../../shared/config";
import { BrandLogo, MainRegion, NavItem, SkipLink } from "../../../shared/ui";
import {
MainRegion,
MenuButton,
NavItem,
SkipLink,
Wordmark,
useMenuToggle,
} from "../../../shared/ui";
import styles from "./employer-shell.module.css";
const navigation = [
@@ -13,21 +20,41 @@ const navigation = [
] as const;
/**
* Employer cabinet layout, designed for desktop first: a graphite sidebar
* with vertical navigation next to a wide work area. Below 1024px the
* sidebar turns into a top bar with a scrollable section strip.
* Employer cabinet layout, designed for desktop first: a floating 240px
* sidebar with vertical navigation next to a wide work area. Below 1024px
* the sidebar turns into a sticky header plate whose sections open from a
* menu button.
*/
export function EmployerShell() {
const menu = useMenuToggle();
return (
<div className={styles.shell}>
<SkipLink />
<header className={styles.sidebar}>
<BrandLogo tone="dark" to={paths.employer.root} context="Кабинет работодателя" />
<nav className={styles.nav} aria-label="Разделы кабинета работодателя">
<div className={styles.top}>
<div className={styles.brand}>
<Wordmark to={paths.employer.root} />
<span className={styles.context}>Кабинет работодателя</span>
</div>
<MenuButton
className={styles.toggle}
menuId={menu.menuId}
isOpen={menu.isOpen}
onToggle={menu.toggle}
buttonRef={menu.buttonRef}
/>
</div>
<nav
id={menu.menuId}
className={styles.nav}
data-open={menu.isOpen || undefined}
aria-label="Разделы кабинета работодателя"
>
<ul className={styles.list}>
{navigation.map((item) => (
<li key={item.to}>
<NavItem to={item.to} tone="dark">
<NavItem to={item.to} layout="rail">
{item.label}
</NavItem>
</li>
@@ -1,3 +1,4 @@
/* Mobile first: base rules target 360px; wider screens add layout. */
.shell {
display: grid;
grid-template-rows: auto 1fr auto;
@@ -5,38 +6,96 @@
}
.header {
display: flex;
flex-wrap: wrap;
gap: var(--space-2) var(--space-5);
align-items: center;
justify-content: space-between;
padding: var(--space-3) var(--gutter);
border-bottom: var(--line-thin) solid var(--color-divider);
background: var(--color-surface);
position: sticky;
z-index: 20;
top: 0;
}
/* Below 700px the navigation is a dropdown under the plate. */
.nav {
display: flex;
flex-wrap: wrap;
position: absolute;
top: calc(100% + var(--space-2));
right: 0;
left: 0;
display: none;
padding: var(--space-2);
border: var(--line-thin) solid var(--color-border-hover);
border-radius: var(--radius-m);
background: var(--color-surface-elevated);
box-shadow: var(--shadow-popover);
}
.nav[data-open] {
display: block;
animation: drop var(--duration-base) var(--easing-emphasized);
}
.list {
display: grid;
gap: var(--space-1);
margin: 0 calc(-1 * var(--space-3));
margin: 0;
padding: 0;
list-style: none;
}
.list a {
width: 100%;
}
.main {
width: 100%;
}
.footer {
display: flex;
flex-wrap: wrap;
gap: var(--space-2) var(--space-5);
align-items: center;
justify-content: space-between;
padding: var(--space-4) var(--gutter);
margin-top: var(--space-8);
border-top: var(--line-thin) solid var(--color-divider);
color: var(--color-text-secondary);
font-size: var(--font-size-s);
background: var(--color-surface);
}
.footer-inner {
display: grid;
gap: var(--space-3);
align-items: center;
max-width: calc(var(--content-width-wide) + 2 * var(--gutter));
margin-inline: auto;
padding: var(--space-6) var(--gutter);
color: var(--color-text-secondary);
font-size: var(--font-size-s);
}
.note {
max-width: 38rem;
}
@media (width >= 43.75rem) {
.toggle {
display: none;
}
.nav,
.nav[data-open] {
position: static;
display: block;
padding: 0;
border: 0;
background: none;
box-shadow: none;
animation: none;
}
.list {
display: flex;
}
.footer-inner {
grid-template-columns: auto minmax(0, 1fr) auto;
gap: var(--space-6);
}
}
@keyframes drop {
from {
opacity: 0;
transform: translateY(-4px);
}
}
@@ -1,35 +1,72 @@
import { Outlet } from "react-router-dom";
import { paths } from "../../../shared/config";
import { BrandLogo, MainRegion, NavItem, SkipLink, TextLink } from "../../../shared/ui";
import {
HeaderPlate,
MainRegion,
MenuButton,
NavItem,
SkipLink,
TextLink,
Wordmark,
useMenuToggle,
} from "../../../shared/ui";
import styles from "./public-shell.module.css";
/** Layout of public pages: sign-in, registration, email confirmation, support. */
const navigation = [
{ to: paths.support, label: "Поддержка" },
{ to: paths.login, label: "Вход" },
{ to: paths.register, label: "Регистрация" },
] as const;
/**
* Layout of public pages: the landing, sign-in, registration, email
* confirmation, and support. Below 700px the links collapse behind a menu
* button.
*/
export function PublicShell() {
const menu = useMenuToggle();
return (
<div className={styles.shell}>
<SkipLink />
<header className={styles.header}>
<BrandLogo />
<nav aria-label="Публичные разделы">
<ul className={styles.nav}>
<li>
<NavItem to={paths.login}>Вход</NavItem>
</li>
<li>
<NavItem to={paths.register}>Регистрация</NavItem>
</li>
<li>
<NavItem to={paths.support}>Поддержка</NavItem>
</li>
</ul>
</nav>
<HeaderPlate>
<Wordmark />
<MenuButton
className={styles.toggle}
menuId={menu.menuId}
isOpen={menu.isOpen}
onToggle={menu.toggle}
buttonRef={menu.buttonRef}
/>
<nav
id={menu.menuId}
className={styles.nav}
data-open={menu.isOpen || undefined}
aria-label="Публичные разделы"
>
<ul className={styles.list}>
{navigation.map((item) => (
<li key={item.to}>
<NavItem to={item.to}>{item.label}</NavItem>
</li>
))}
</ul>
</nav>
</HeaderPlate>
</header>
<MainRegion className={styles.main}>
<Outlet />
</MainRegion>
<footer className={styles.footer}>
<p>Lincodex. Каркас интерфейса: пользовательские сценарии в разработке.</p>
<TextLink to={paths.status}>Технический статус</TextLink>
<div className={styles["footer-inner"]}>
<Wordmark size="s" />
<p className={styles.note}>
Подбор в ИТ по категории, которую подтверждает тест. Контакты кандидата открываются
только с его согласия.
</p>
<TextLink to={paths.status}>Технический статус</TextLink>
</div>
</footer>
</div>
);