1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
"use client";
import { CalendarDays, NotebookPen, Sparkles, Target } from "lucide-react";
import type { TabId } from "@/lib/types";
import { cn } from "@/lib/utils";
const TABS: { id: TabId; label: string; icon: typeof NotebookPen }[] = [
{ id: "notes", label: "Заметки", icon: NotebookPen },
{ id: "calendar", label: "Календарь", icon: CalendarDays },
{ id: "goals", label: "Цели", icon: Target },
{ id: "ai", label: "ИИ", icon: Sparkles },
];
export function BottomNav({
tab,
onChange,
}: {
tab: TabId;
onChange: (t: TabId) => void;
}) {
const activeIndex = TABS.findIndex((t) => t.id === tab);
return (
<nav
aria-label="Основная навигация"
data-bottom-nav
className="shrink-0 px-4 pb-4"
>
<div className="relative flex items-center rounded-full border border-line/70 bg-card/70 p-1.5 shadow-[0_8px_32px_-12px_rgba(0,0,0,0.35)] backdrop-blur-xl">
{}
<span
aria-hidden
className="absolute top-1.5 bottom-1.5 rounded-full bg-accent-soft transition-transform duration-300 ease-[cubic-bezier(0.22,1,0.36,1)]"
style={{
width: `calc((100% - 0.75rem) / ${TABS.length})`,
left: "0.375rem",
transform: `translateX(${activeIndex * 100}%)`,
}}
/>
{TABS.map(({ id, label, icon: Icon }) => {
const active = id === tab;
return (
<button
key={id}
onClick={() => onChange(id)}
aria-current={active ? "page" : undefined}
className={cn(
"relative z-10 flex flex-1 flex-col items-center gap-0.5 rounded-full py-2 transition-colors duration-200",
"focus-visible:outline-2 focus-visible:outline-accent active:scale-95",
active ? "text-accent-strong" : "text-faint hover:text-body"
)}
>
<Icon className="h-5 w-5" strokeWidth={active ? 2.4 : 2} />
<span className="text-[10px] font-bold tracking-wide">{label}</span>
</button>
);
})}
</div>
</nav>
);
}