aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/packages/ui-new/src/components/ui/scroll-area.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/ui-new/src/components/ui/scroll-area.tsx')
-rw-r--r--packages/ui-new/src/components/ui/scroll-area.tsx23
1 files changed, 10 insertions, 13 deletions
diff --git a/packages/ui-new/src/components/ui/scroll-area.tsx b/packages/ui-new/src/components/ui/scroll-area.tsx
index da6b2e2..4a68eb2 100644
--- a/packages/ui-new/src/components/ui/scroll-area.tsx
+++ b/packages/ui-new/src/components/ui/scroll-area.tsx
@@ -1,13 +1,13 @@
-import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
-import type * as React from "react";
+"use client";
+import { ScrollArea as ScrollAreaPrimitive } from "@base-ui/react/scroll-area";
import { cn } from "@/lib/utils";
function ScrollArea({
className,
children,
...props
-}: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {
+}: ScrollAreaPrimitive.Root.Props) {
return (
<ScrollAreaPrimitive.Root
data-slot="scroll-area"
@@ -30,26 +30,23 @@ function ScrollBar({
className,
orientation = "vertical",
...props
-}: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
+}: ScrollAreaPrimitive.Scrollbar.Props) {
return (
- <ScrollAreaPrimitive.ScrollAreaScrollbar
+ <ScrollAreaPrimitive.Scrollbar
data-slot="scroll-area-scrollbar"
+ data-orientation={orientation}
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",
+ "data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none",
className,
)}
{...props}
>
- <ScrollAreaPrimitive.ScrollAreaThumb
+ <ScrollAreaPrimitive.Thumb
data-slot="scroll-area-thumb"
- className="bg-border relative flex-1 rounded-full"
+ className="rounded-none bg-border relative flex-1"
/>
- </ScrollAreaPrimitive.ScrollAreaScrollbar>
+ </ScrollAreaPrimitive.Scrollbar>
);
}