feat(frontend): add cabinet shells, brand tokens, and state primitives
This commit is contained in:
1 parent
dda3825786
commit
0e2a3b02ab
85 files changed
+3313
-113
No files matched your search
@@ -1 +0,0 @@
|
||||
export { HomePage } from "./ui/home-page";
|
||||
@@ -1,54 +0,0 @@
|
||||
.page {
|
||||
display: grid;
|
||||
min-height: 100vh;
|
||||
padding: 2rem;
|
||||
place-items: center;
|
||||
}
|
||||
|
||||
.panel {
|
||||
width: min(100%, 38rem);
|
||||
padding: clamp(1.5rem, 5vw, 3rem);
|
||||
border: 1px solid #dce3e9;
|
||||
border-radius: 1.25rem;
|
||||
background: #fff;
|
||||
box-shadow: 0 1.5rem 4rem rgb(21 32 43 / 8%);
|
||||
}
|
||||
|
||||
.status-mark {
|
||||
display: block;
|
||||
width: 0.65rem;
|
||||
height: 0.65rem;
|
||||
margin-bottom: 1.75rem;
|
||||
border-radius: 50%;
|
||||
background: #477a68;
|
||||
}
|
||||
|
||||
.eyebrow {
|
||||
margin: 0 0 0.75rem;
|
||||
color: #52616f;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.panel h1 {
|
||||
margin: 0;
|
||||
font-size: clamp(1.8rem, 5vw, 2.5rem);
|
||||
letter-spacing: -0.04em;
|
||||
line-height: 1.15;
|
||||
}
|
||||
|
||||
.description {
|
||||
max-width: 31rem;
|
||||
margin: 1rem 0 0;
|
||||
color: #52616f;
|
||||
font-size: 1rem;
|
||||
line-height: 1.65;
|
||||
}
|
||||
|
||||
@media (width <= 36rem) {
|
||||
.page {
|
||||
padding: 1rem;
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
import styles from "./home-page.module.css";
|
||||
|
||||
export function HomePage() {
|
||||
return (
|
||||
<main className={styles.page}>
|
||||
<section aria-labelledby="page-title" className={styles.panel}>
|
||||
<span aria-hidden="true" className={styles["status-mark"]} />
|
||||
<p className={styles.eyebrow}>Lincodex</p>
|
||||
<h1 id="page-title">Интерфейсная основа</h1>
|
||||
<p className={styles.description}>
|
||||
Сейчас доступен экран статуса каркаса. Пользовательские сценарии еще не подключены.
|
||||
</p>
|
||||
</section>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export { NotFoundPage } from "./ui/not-found-page";
|
||||
@@ -0,0 +1,29 @@
|
||||
import { useLocation } from "react-router-dom";
|
||||
import { ButtonLink, Mono, Page } from "../../../shared/ui";
|
||||
|
||||
type NotFoundPageProps = {
|
||||
/** Where the recovery link leads, for example the current cabinet. */
|
||||
homePath?: string;
|
||||
homeLabel?: string;
|
||||
};
|
||||
|
||||
export function NotFoundPage({ homePath = "/", homeLabel = "На главную" }: NotFoundPageProps) {
|
||||
const { pathname } = useLocation();
|
||||
|
||||
return (
|
||||
<Page
|
||||
title="Страница не найдена"
|
||||
eyebrow="Ошибка 404"
|
||||
lead={
|
||||
<>
|
||||
Адрес <Mono>{pathname}</Mono> не ведет ни на один экран. Проверьте ссылку или вернитесь к
|
||||
началу.
|
||||
</>
|
||||
}
|
||||
>
|
||||
<div>
|
||||
<ButtonLink to={homePath}>{homeLabel}</ButtonLink>
|
||||
</div>
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
export { PlaceholderPage } from "./ui/placeholder-page";
|
||||
export type { ScreenId } from "./model/screens";
|
||||
@@ -0,0 +1,142 @@
|
||||
/**
|
||||
* Screen map from the product requirements. Each entry is a placeholder
|
||||
* until its business task implements the real screen; the "planned" lines
|
||||
* describe intent, not implemented behavior.
|
||||
*/
|
||||
export type ScreenArea = "public" | "candidate" | "employer";
|
||||
|
||||
export type ScreenPlan = {
|
||||
area: ScreenArea;
|
||||
title: string;
|
||||
planned: readonly string[];
|
||||
};
|
||||
|
||||
export const areaLabels: Readonly<Record<ScreenArea, string>> = {
|
||||
public: "Публичный раздел",
|
||||
candidate: "Кабинет кандидата",
|
||||
employer: "Кабинет работодателя",
|
||||
};
|
||||
|
||||
export const screens = {
|
||||
login: {
|
||||
area: "public",
|
||||
title: "Вход",
|
||||
planned: ["Вход по почте и паролю", "Восстановление доступа", "Переход в кабинет по роли"],
|
||||
},
|
||||
register: {
|
||||
area: "public",
|
||||
title: "Регистрация",
|
||||
planned: [
|
||||
"Выбор сценария: кандидат или работодатель",
|
||||
"Согласие на обработку персональных данных",
|
||||
"Письмо для подтверждения почты",
|
||||
],
|
||||
},
|
||||
verifyEmail: {
|
||||
area: "public",
|
||||
title: "Подтверждение почты",
|
||||
planned: [
|
||||
"Проверка ссылки из письма",
|
||||
"Повторная отправка письма",
|
||||
"Понятное сообщение об устаревшей ссылке",
|
||||
],
|
||||
},
|
||||
support: {
|
||||
area: "public",
|
||||
title: "Поддержка",
|
||||
planned: [
|
||||
"Контакты поддержки",
|
||||
"Ответы на частые вопросы",
|
||||
"Как передать идентификатор запроса при ошибке",
|
||||
],
|
||||
},
|
||||
candidateHome: {
|
||||
area: "candidate",
|
||||
title: "Главная",
|
||||
planned: [
|
||||
"Текущая категория и подтвержденный грейд",
|
||||
"Следующий шаг по профилю",
|
||||
"Новые приглашения",
|
||||
],
|
||||
},
|
||||
candidateOnboarding: {
|
||||
area: "candidate",
|
||||
title: "Первые шаги",
|
||||
planned: [
|
||||
"Согласия и видимость профиля",
|
||||
"Анкета и ожидаемый грейд",
|
||||
"Переход к первому тесту",
|
||||
],
|
||||
},
|
||||
candidateProfile: {
|
||||
area: "candidate",
|
||||
title: "Профиль",
|
||||
planned: [
|
||||
"Специальность и навыки",
|
||||
"Резюме и достижения ФСП",
|
||||
"Контакты, скрытые от компаний до приглашения",
|
||||
],
|
||||
},
|
||||
candidateAssessment: {
|
||||
area: "candidate",
|
||||
title: "Тест",
|
||||
planned: ["Выбор уровня теста", "Прохождение заданий", "Сохранение ответов"],
|
||||
},
|
||||
candidateResults: {
|
||||
area: "candidate",
|
||||
title: "Результаты",
|
||||
planned: [
|
||||
"Подтвержденная категория",
|
||||
"История попыток и грейдов",
|
||||
"Разбор результата по компетенциям",
|
||||
],
|
||||
},
|
||||
candidateInvitations: {
|
||||
area: "candidate",
|
||||
title: "Приглашения",
|
||||
planned: [
|
||||
"Предложения компаний с вилкой зарплаты",
|
||||
"Принятие или отказ",
|
||||
"Какие компании получили доступ к контактам",
|
||||
],
|
||||
},
|
||||
candidatePrivacy: {
|
||||
area: "candidate",
|
||||
title: "Приватность",
|
||||
planned: ["Видимость профиля в поиске", "Отзыв согласий", "Журнал доступа к контактам"],
|
||||
},
|
||||
employerCompany: {
|
||||
area: "employer",
|
||||
title: "Компания и команда",
|
||||
planned: ["Профиль компании", "Участники и их роли", "Приглашение коллег"],
|
||||
},
|
||||
employerNeeds: {
|
||||
area: "employer",
|
||||
title: "Потребности",
|
||||
planned: [
|
||||
"Описание потребности",
|
||||
"Подтверждение извлеченных навыков",
|
||||
"Фильтры поиска кандидатов",
|
||||
],
|
||||
},
|
||||
employerCandidates: {
|
||||
area: "employer",
|
||||
title: "Кандидаты",
|
||||
planned: [
|
||||
"Объяснимая выдача по потребности",
|
||||
"Шортлист",
|
||||
"Псевдонимы вместо контактов до принятия приглашения",
|
||||
],
|
||||
},
|
||||
employerInvitations: {
|
||||
area: "employer",
|
||||
title: "Приглашения",
|
||||
planned: [
|
||||
"Отправленные предложения",
|
||||
"Статусы: отправлено, просмотрено, принято, отклонено",
|
||||
"Доступ к контактам после принятия",
|
||||
],
|
||||
},
|
||||
} as const satisfies Record<string, ScreenPlan>;
|
||||
|
||||
export type ScreenId = keyof typeof screens;
|
||||
@@ -0,0 +1,43 @@
|
||||
.notice {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-2) var(--space-3);
|
||||
align-items: baseline;
|
||||
padding: var(--space-4) var(--space-5);
|
||||
border: var(--line-thin) dashed var(--color-border-strong);
|
||||
border-radius: var(--radius-m);
|
||||
background: var(--color-surface);
|
||||
}
|
||||
|
||||
.tag {
|
||||
padding: 0 var(--space-2);
|
||||
border: var(--line-thin) solid var(--color-accent);
|
||||
border-radius: var(--radius-pill);
|
||||
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;
|
||||
}
|
||||
|
||||
.plan {
|
||||
display: grid;
|
||||
gap: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.plan li {
|
||||
display: grid;
|
||||
grid-template-columns: 2.5rem minmax(0, 1fr);
|
||||
gap: var(--space-3);
|
||||
padding: var(--space-3) 0;
|
||||
border-bottom: var(--line-thin) solid var(--color-divider);
|
||||
font-size: var(--font-size-l);
|
||||
line-height: var(--line-height-snug);
|
||||
}
|
||||
|
||||
.plan li > :first-child {
|
||||
color: var(--color-accent);
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import { Mono, Page, Section } from "../../../shared/ui";
|
||||
import { areaLabels, screens, type ScreenId } from "../model/screens";
|
||||
import styles from "./placeholder-page.module.css";
|
||||
|
||||
type PlaceholderPageProps = {
|
||||
screen: ScreenId;
|
||||
};
|
||||
|
||||
/**
|
||||
* Honest stand-in for a screen that a later task implements. It names the
|
||||
* screen and lists what is planned, without imitating working features.
|
||||
*/
|
||||
export function PlaceholderPage({ screen }: PlaceholderPageProps) {
|
||||
const plan = screens[screen];
|
||||
|
||||
return (
|
||||
<Page
|
||||
title={plan.title}
|
||||
eyebrow={areaLabels[plan.area]}
|
||||
width={plan.area === "employer" ? "wide" : "narrow"}
|
||||
>
|
||||
<p className={styles.notice}>
|
||||
<span className={styles.tag}>Заготовка</span>
|
||||
Экран будет реализован в одной из следующих задач. Сейчас здесь нет данных и действий.
|
||||
</p>
|
||||
<Section title="Что здесь появится" headingLevel={2}>
|
||||
<ol className={styles.plan}>
|
||||
{plan.planned.map((item, index) => (
|
||||
<li key={item}>
|
||||
<Mono>{String(index + 1).padStart(2, "0")}</Mono>
|
||||
<span>{item}</span>
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
</Section>
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export { StatusPage } from "./ui/status-page";
|
||||
@@ -0,0 +1,11 @@
|
||||
.success {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-4);
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: var(--space-5);
|
||||
border: var(--line-thin) solid var(--color-divider);
|
||||
border-radius: var(--radius-m);
|
||||
background: var(--color-surface);
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { ApiRequestError } from "../../../shared/api";
|
||||
import {
|
||||
Button,
|
||||
EmptyState,
|
||||
ForbiddenState,
|
||||
LoadingState,
|
||||
Mono,
|
||||
QueryView,
|
||||
SavingStatus,
|
||||
Section,
|
||||
Stack,
|
||||
TrustLevel,
|
||||
} from "../../../shared/ui";
|
||||
import styles from "./state-fixtures.module.css";
|
||||
|
||||
const fixtureDelayMs = 600;
|
||||
let fixtureAttempts = 0;
|
||||
|
||||
function wait(ms: number): Promise<void> {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(resolve, ms);
|
||||
});
|
||||
}
|
||||
|
||||
// Built on demand so production bundles keep no fixture objects.
|
||||
function forbiddenFixture(): ApiRequestError {
|
||||
return new ApiRequestError({
|
||||
status: 403,
|
||||
code: "forbidden",
|
||||
title: "Forbidden",
|
||||
traceId: "fixture-trace-0002",
|
||||
});
|
||||
}
|
||||
|
||||
// Fails on every odd attempt, so "retry" visibly recovers.
|
||||
async function flakyFixtureRequest(): Promise<{ attempt: number }> {
|
||||
fixtureAttempts += 1;
|
||||
const attempt = fixtureAttempts;
|
||||
await wait(fixtureDelayMs);
|
||||
if (attempt % 2 === 1) {
|
||||
throw new ApiRequestError({
|
||||
status: 500,
|
||||
code: "internal",
|
||||
title: "Internal server error",
|
||||
detail: "Fixture failure for the development state gallery.",
|
||||
traceId: "fixture-trace-0001",
|
||||
});
|
||||
}
|
||||
return { attempt };
|
||||
}
|
||||
|
||||
function FlakyRequestFixture() {
|
||||
const query = useQuery({
|
||||
queryKey: ["dev-fixture", "flaky-request"],
|
||||
queryFn: flakyFixtureRequest,
|
||||
retry: false,
|
||||
staleTime: Infinity,
|
||||
});
|
||||
|
||||
return (
|
||||
<QueryView query={query} loadingLabel="Выполняем запрос-фикстуру...">
|
||||
{(result) => (
|
||||
<div className={styles.success}>
|
||||
<p>
|
||||
Повторный запрос выполнен, попытка <Mono strong>{result.attempt}</Mono>.
|
||||
</p>
|
||||
<Button
|
||||
variant="secondary"
|
||||
isBusy={query.isFetching}
|
||||
onClick={() => {
|
||||
void query.refetch();
|
||||
}}
|
||||
>
|
||||
Снова получить ошибку
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
</QueryView>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Development-only gallery of shared states. Every value here is a local
|
||||
* fixture; nothing comes from the server or proves an API workflow.
|
||||
*/
|
||||
export function StateFixtures() {
|
||||
return (
|
||||
<Section
|
||||
title="Состояния экранов"
|
||||
description="Видно только в режиме разработки. Все данные здесь вымышленные и не приходят с сервера."
|
||||
>
|
||||
<Section title="Ошибка и повтор" headingLevel={3}>
|
||||
<FlakyRequestFixture />
|
||||
</Section>
|
||||
<Section title="Загрузка" headingLevel={3}>
|
||||
<LoadingState />
|
||||
</Section>
|
||||
<Section title="Пусто" headingLevel={3}>
|
||||
<EmptyState
|
||||
title="Приглашений пока нет"
|
||||
description="Когда компания отправит предложение, оно появится здесь."
|
||||
/>
|
||||
</Section>
|
||||
<Section title="Нет доступа" headingLevel={3}>
|
||||
<ForbiddenState error={forbiddenFixture()} />
|
||||
</Section>
|
||||
<Section title="Сохранение" headingLevel={3}>
|
||||
<Stack gap={1}>
|
||||
<SavingStatus state="saving" />
|
||||
<SavingStatus state="saved" />
|
||||
<SavingStatus state="failed" />
|
||||
</Stack>
|
||||
</Section>
|
||||
<Section title="Уровни доверия" headingLevel={3}>
|
||||
<Stack gap={2}>
|
||||
<TrustLevel level="none" />
|
||||
<TrustLevel level="claimed" />
|
||||
<TrustLevel level="partial" />
|
||||
<TrustLevel level="confirmed" />
|
||||
</Stack>
|
||||
</Section>
|
||||
<Section title="Числа и псевдонимы" headingLevel={3}>
|
||||
<p>
|
||||
Кандидат <Mono strong>K-0427</Mono>, результат <Mono strong>87 / 100</Mono>, попытка{" "}
|
||||
<Mono>2</Mono> от <Mono>14.09.2026</Mono>.
|
||||
</p>
|
||||
</Section>
|
||||
</Section>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { Page } from "../../../shared/ui";
|
||||
import { SystemStatus } from "../../../widgets/system-status";
|
||||
import { StateFixtures } from "./state-fixtures";
|
||||
|
||||
/**
|
||||
* Service page for developers and operations. It is linked from the public
|
||||
* footer only and is explicitly not a product readiness indicator.
|
||||
*/
|
||||
export function StatusPage() {
|
||||
return (
|
||||
<Page
|
||||
title="Технический статус"
|
||||
eyebrow="Служебная страница"
|
||||
lead="Показывает, отвечает ли процесс API. Это не показатель готовности продукта: пользовательские сценарии здесь не проверяются."
|
||||
>
|
||||
<SystemStatus />
|
||||
{import.meta.env.DEV ? <StateFixtures /> : null}
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export { WelcomePage } from "./ui/welcome-page";
|
||||
@@ -0,0 +1,79 @@
|
||||
.cabinets {
|
||||
display: grid;
|
||||
gap: var(--space-4);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.card {
|
||||
position: relative;
|
||||
display: grid;
|
||||
gap: var(--space-2);
|
||||
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;
|
||||
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);
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
.summary {
|
||||
color: var(--color-text-secondary);
|
||||
}
|
||||
|
||||
.state {
|
||||
width: fit-content;
|
||||
padding: 0 var(--space-2);
|
||||
border: var(--line-thin) dashed var(--color-border-strong);
|
||||
border-radius: var(--radius-pill);
|
||||
font-size: var(--font-size-xs);
|
||||
}
|
||||
|
||||
@media (width >= 48rem) {
|
||||
.cabinets {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
import { Link } from "react-router-dom";
|
||||
import { paths } from "../../../shared/config";
|
||||
import { Page, Section, TextLink } from "../../../shared/ui";
|
||||
import styles from "./welcome-page.module.css";
|
||||
|
||||
const cabinets = [
|
||||
{
|
||||
to: paths.candidate.root,
|
||||
title: "Кабинет кандидата",
|
||||
format: "Для телефона",
|
||||
summary: "Профиль, тест, результаты, приглашения и настройки приватности.",
|
||||
},
|
||||
{
|
||||
to: paths.employer.root,
|
||||
title: "Кабинет работодателя",
|
||||
format: "Для компьютера",
|
||||
summary: "Компания и команда, потребности, подбор кандидатов и приглашения.",
|
||||
},
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* Public start page. It states plainly that only the interface scaffold
|
||||
* exists, so it cannot be mistaken for a working product.
|
||||
*/
|
||||
export function WelcomePage() {
|
||||
return (
|
||||
<Page
|
||||
title="Протокол подтвержденных навыков"
|
||||
eyebrow="Lincodex"
|
||||
lead="Сейчас доступен только каркас интерфейса: навигация, общие состояния экранов и оформление. Вход, регистрация и рабочие сценарии кабинетов появятся в следующих задачах."
|
||||
>
|
||||
<Section title="Кабинеты">
|
||||
<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>
|
||||
<span className={styles.state}>Пустой каркас</span>
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</Section>
|
||||
<Section title="Публичные страницы">
|
||||
<p>
|
||||
Заготовки: <TextLink to={paths.login}>вход</TextLink>,{" "}
|
||||
<TextLink to={paths.register}>регистрация</TextLink>,{" "}
|
||||
<TextLink to={paths.verifyEmail}>подтверждение почты</TextLink> и{" "}
|
||||
<TextLink to={paths.support}>поддержка</TextLink>.
|
||||
</p>
|
||||
</Section>
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user