Open History to see the last commit
1import type { ComponentProps } from "react";
2import type { ResizableWidthHandlers } from "~/hooks/useResizableWidth";
3import { cn } from "~/lib/utils";
4
5interface Props extends Pick<
6 ComponentProps<"div">,
7 "tabIndex" | "onKeyDown" | "aria-valuenow" | "aria-valuemin" | "aria-valuemax"
8> {
9 handlers: ResizableWidthHandlers;
10 className?: string;
11 label?: string;
12}
13
14export function RightPanelResizeHandle({ handlers, className, label, ...separatorProps }: Props) {
15 return (
16 <div
17 role="separator"
18 aria-label={label}
19 aria-orientation="vertical"
20 {...separatorProps}
21 className={cn(
22 "group absolute inset-y-0 -left-1 z-20 w-2 cursor-col-resize select-none",
23 className,
24 )}
25 {...handlers}
26 >
27 <span
28 aria-hidden
29 className="pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover:bg-border group-focus-visible:bg-primary/60 group-active:bg-primary/60"
30 />
31 </div>
32 );
33}