diff --git a/src/ui/scroll-area.tsx b/src/ui/scroll-area.tsx index 097655a..c2395dc 100644 --- a/src/ui/scroll-area.tsx +++ b/src/ui/scroll-area.tsx @@ -3,20 +3,26 @@ import * as React from "react" import { cn } from "@/lib/utils" import { ScrollArea as ScrollAreaPrimitive } from "radix-ui" +// Как tui-scrollbar в старом UI: нативный скролл скрыт, поверх контента — +// тонкий бегунок, который проявляется при наведении/прокрутке и гаснет. function ScrollArea({ className, children, + type = "hover", + scrollHideDelay = 700, ...props }: React.ComponentProps) { return ( {children} @@ -36,18 +42,17 @@ function ScrollBar({ data-slot="scroll-area-scrollbar" orientation={orientation} className={cn( - "flex touch-none p-px transition-colors select-none", - orientation === "vertical" && - "h-full w-2.5 border-l border-l-transparent", - orientation === "horizontal" && - "h-2.5 flex-col border-t border-t-transparent", + "group/bar z-20 flex touch-none p-0.5 select-none", + "data-[state=visible]:animate-in data-[state=visible]:fade-in-0 data-[state=hidden]:animate-out data-[state=hidden]:fade-out-0", + orientation === "vertical" && "h-full w-2 hover:w-2.5", + orientation === "horizontal" && "h-2 flex-col hover:h-2.5", className )} {...props} > )