feat(frontend): add cabinet shells, brand tokens, and state primitives

This commit is contained in:
shira committed 2026-10-06 01:09:08 +03:00
1 parent dda3825786
commit 0e2a3b02ab
85 files changed
+3313 -113

No files matched your search

@@ -0,0 +1,76 @@
/* Desktop first: base rules target 1024px and wider; narrow screens adapt. */
.shell {
display: grid;
grid-template-columns: 17rem minmax(0, 1fr);
min-height: 100vh;
}
/* 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;
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);
}
.nav {
border-top: var(--line-thin) solid var(--palette-graphite-soft);
padding-top: var(--space-4);
}
.list {
display: grid;
gap: var(--space-1);
margin: 0;
padding: 0;
list-style: none;
}
.list a {
width: 100%;
}
.main {
min-width: 0;
}
@media (width < 64rem) {
.shell {
grid-template-columns: minmax(0, 1fr);
grid-template-rows: auto 1fr;
}
.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);
}
.list a {
width: auto;
}
}
@@ -0,0 +1,41 @@
import { Outlet } from "react-router-dom";
import { paths } from "../../../shared/config";
import { BrandLogo, MainRegion, NavItem, SkipLink } from "../../../shared/ui";
import styles from "./employer-shell.module.css";
const navigation = [
{ to: paths.employer.company, label: "Компания и команда" },
{ to: paths.employer.needs, label: "Потребности" },
{ to: paths.employer.candidates, label: "Кандидаты" },
{ to: paths.employer.invitations, label: "Приглашения" },
] 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.
*/
export function EmployerShell() {
return (
<div className={styles.shell}>
<SkipLink />
<header className={styles.sidebar}>
<BrandLogo tone="dark" to={paths.employer.root} context="Кабинет работодателя" />
<nav className={styles.nav} aria-label="Разделы кабинета работодателя">
<ul className={styles.list}>
{navigation.map((item) => (
<li key={item.to}>
<NavItem to={item.to} tone="dark">
{item.label}
</NavItem>
</li>
))}
</ul>
</nav>
</header>
<MainRegion className={styles.main}>
<Outlet />
</MainRegion>
</div>
);
}