|
1 | | -"use client" |
| 1 | +'use client'; |
2 | 2 |
|
3 | | -import * as React from "react" |
4 | | -import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area" |
| 3 | +import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area'; |
| 4 | +import * as React from 'react'; |
| 5 | +import { cn } from '~/utils/cn'; |
5 | 6 |
|
6 | | -import { cn } from "~/lib/utils" |
7 | | - |
8 | | -function ScrollArea({ |
9 | | - className, |
10 | | - children, |
11 | | - ...props |
12 | | -}: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) { |
| 7 | +function ScrollArea({ className, children, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) { |
13 | 8 | return ( |
14 | 9 | <ScrollAreaPrimitive.Root |
15 | 10 | data-slot="scroll-area" |
16 | | - className={cn("relative", className)} |
| 11 | + className={cn('relative', className)} |
17 | 12 | {...props} |
18 | 13 | > |
19 | 14 | <ScrollAreaPrimitive.Viewport |
20 | 15 | data-slot="scroll-area-viewport" |
21 | | - className="focus-visible:ring-neutral-950/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1 dark:focus-visible:ring-neutral-300/50" |
| 16 | + className="size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-neutral-950/50 focus-visible:outline-1 dark:focus-visible:ring-neutral-300/50" |
22 | 17 | > |
23 | 18 | {children} |
24 | 19 | </ScrollAreaPrimitive.Viewport> |
25 | 20 | <ScrollBar /> |
26 | 21 | <ScrollAreaPrimitive.Corner /> |
27 | 22 | </ScrollAreaPrimitive.Root> |
28 | | - ) |
| 23 | + ); |
29 | 24 | } |
30 | 25 |
|
31 | | -function ScrollBar({ |
32 | | - className, |
33 | | - orientation = "vertical", |
34 | | - ...props |
35 | | -}: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) { |
| 26 | +function ScrollBar({ className, orientation = 'vertical', ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) { |
36 | 27 | return ( |
37 | 28 | <ScrollAreaPrimitive.ScrollAreaScrollbar |
38 | 29 | data-slot="scroll-area-scrollbar" |
39 | 30 | orientation={orientation} |
40 | 31 | className={cn( |
41 | | - "flex touch-none p-px transition-colors select-none", |
42 | | - orientation === "vertical" && |
43 | | - "h-full w-2.5 border-l border-l-transparent", |
44 | | - orientation === "horizontal" && |
45 | | - "h-2.5 flex-col border-t border-t-transparent", |
| 32 | + 'flex touch-none p-px transition-colors select-none', |
| 33 | + orientation === 'vertical' && 'h-full w-2.5 border-l border-l-transparent', |
| 34 | + orientation === 'horizontal' && 'h-2.5 flex-col border-t border-t-transparent', |
46 | 35 | className |
47 | 36 | )} |
48 | 37 | {...props} |
49 | 38 | > |
50 | 39 | <ScrollAreaPrimitive.ScrollAreaThumb |
51 | 40 | data-slot="scroll-area-thumb" |
52 | | - className="bg-neutral-200 relative flex-1 rounded-full dark:bg-neutral-800" |
| 41 | + className="relative flex-1 rounded-full bg-neutral-200 dark:bg-neutral-800" |
53 | 42 | /> |
54 | 43 | </ScrollAreaPrimitive.ScrollAreaScrollbar> |
55 | | - ) |
| 44 | + ); |
56 | 45 | } |
57 | 46 |
|
58 | | -export { ScrollArea, ScrollBar } |
| 47 | +export { ScrollArea, ScrollBar }; |
0 commit comments