Files
brand_book/apps/web/components/layout/Sidebar.tsx
T
AR 15 M4 5105310c92 feat(sprint-1): инициализация monorepo, Next.js, NestJS, страница логотипа
Инфраструктура:
- pnpm workspaces monorepo (apps/web, apps/api, packages/)
- docker-compose.yml: PostgreSQL 16
- .env.example: DATABASE_URL, API_PORT, NEXT_PUBLIC_API_URL

Backend (apps/api — NestJS 11):
- Инициализирован NestJS с pnpm
- Prisma 7 + prisma.config.ts подключен к PostgreSQL
- Схема: User (role: viewer/editor), ExperimentalComponent (status: draft/review/approved)

Frontend (apps/web — Next.js 16):
- App Router, TypeScript, Tailwind CSS 4, Fira Sans (Google Fonts)
- globals.css: CSS-токены бренда (цвета 053M–080M, шрифты)
- layout.tsx: корневой layout с боковой навигацией
- Sidebar.tsx: навигация по всем разделам (Фундамент, Компоненты, Блоки, Страницы, Оффлайн, Эксперименты)
- page.tsx: редирект → /foundation/logo
- /foundation/logo: полная страница «Логотип»
  - Иерархия и версии (Основной / Общий)
  - Цветовые варианты (основной, инвертированный, на форме)
  - Охранная зона с визуализацией
  - Таблица минимальных размеров (форма сотрудников)
  - Недопустимые варианты (6 правил)
  - Блок скачивания (placeholder до получения вектора)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 17:13:42 +05:00

179 lines
6.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"use client";
import Link from "next/link";
import { usePathname } from "next/navigation";
type NavItem = {
label: string;
href: string;
soon?: boolean;
};
type NavSection = {
title: string;
items: NavItem[];
};
const NAV: NavSection[] = [
{
title: "Фундамент",
items: [
{ label: "Логотип", href: "/foundation/logo" },
{ label: "Цвета", href: "/foundation/colors", soon: true },
{ label: "Типографика", href: "/foundation/typography", soon: true },
{ label: "Иконография", href: "/foundation/icons", soon: true },
],
},
{
title: "Компоненты",
items: [
{ label: "Кнопки", href: "/components/buttons", soon: true },
{ label: "Форм-контролы", href: "/components/forms", soon: true },
{ label: "Карточки", href: "/components/cards", soon: true },
{ label: "Бейджи и теги", href: "/components/badges", soon: true },
{ label: "Алерты", href: "/components/alerts", soon: true },
{ label: "Модальные окна", href: "/components/modals", soon: true },
{ label: "Таблицы", href: "/components/tables", soon: true },
{ label: "Навигация", href: "/components/navigation", soon: true },
],
},
{
title: "Блоки",
items: [
{ label: "Hero", href: "/blocks/hero", soon: true },
{ label: "CEO-текст", href: "/blocks/ceo", soon: true },
{ label: "Наши врачи", href: "/blocks/doctors", soon: true },
{ label: "Отзывы", href: "/blocks/reviews", soon: true },
{ label: "Новости", href: "/blocks/news", soon: true },
{ label: "Формы контакта", href: "/blocks/contact-forms", soon: true },
{ label: "Контакт", href: "/blocks/contact", soon: true },
{ label: "Услуги", href: "/blocks/services", soon: true },
],
},
{
title: "Страницы",
items: [
{ label: "Главная", href: "/pages/home", soon: true },
{ label: "Заболевание", href: "/pages/disease", soon: true },
{ label: "Все врачи", href: "/pages/doctors", soon: true },
{ label: "Врач", href: "/pages/doctor", soon: true },
{ label: "Цены", href: "/pages/prices", soon: true },
{ label: "Контакты", href: "/pages/contacts", soon: true },
],
},
{
title: "Оффлайн элементы",
items: [
{ label: "Форма сотрудников", href: "/offline/uniform", soon: true },
{ label: "Бейджи", href: "/offline/badges", soon: true },
{ label: "Навигация", href: "/offline/navigation", soon: true },
{ label: "Транспорт", href: "/offline/transport", soon: true },
{ label: "Печать", href: "/offline/print", soon: true },
],
},
{
title: "Эксперименты",
items: [
{ label: "Библиотека", href: "/experiments", soon: true },
],
},
];
export function Sidebar() {
const pathname = usePathname();
return (
<aside
className="w-64 shrink-0 h-screen overflow-y-auto border-r flex flex-col"
style={{
background: "var(--bb-sidebar-bg)",
borderColor: "var(--bb-sidebar-border)",
}}
>
{/* Логотип брендбука */}
<div
className="px-5 py-4 border-b"
style={{ borderColor: "var(--bb-sidebar-border)" }}
>
<p
className="text-xs font-semibold uppercase tracking-widest mb-0.5"
style={{ color: "var(--brand-053m)" }}
>
Брендбук
</p>
<p
className="text-xs leading-tight"
style={{ color: "var(--bb-sidebar-text-muted)" }}
>
Клиника УХОГОРЛОНОС
<br />
им. проф. Е.Н. Оленевой
</p>
</div>
{/* Навигация */}
<nav className="flex-1 px-3 py-4 space-y-5">
{NAV.map((section) => (
<div key={section.title}>
<p
className="px-2 mb-1 text-[10px] font-semibold uppercase tracking-widest"
style={{ color: "var(--bb-sidebar-section)" }}
>
{section.title}
</p>
<ul className="space-y-0.5">
{section.items.map((item) => {
const isActive = pathname === item.href;
return (
<li key={item.href}>
<Link
href={item.soon ? "#" : item.href}
className="flex items-center justify-between px-2 py-1.5 rounded-md text-sm transition-colors"
style={{
color: isActive
? "var(--brand-073m)"
: item.soon
? "var(--bb-sidebar-text-muted)"
: "var(--bb-sidebar-text)",
background: isActive
? "var(--bb-sidebar-active-bg)"
: "transparent",
fontWeight: isActive ? 500 : 400,
cursor: item.soon ? "default" : "pointer",
}}
>
{item.label}
{item.soon && (
<span
className="text-[10px] px-1.5 py-0.5 rounded"
style={{
background: "#f3f4f6",
color: "var(--bb-sidebar-section)",
}}
>
скоро
</span>
)}
</Link>
</li>
);
})}
</ul>
</div>
))}
</nav>
{/* Версия */}
<div
className="px-5 py-3 border-t text-xs"
style={{
borderColor: "var(--bb-sidebar-border)",
color: "var(--bb-sidebar-text-muted)",
}}
>
Sprint 1 · v0.1.0
</div>
</aside>
);
}