diff --git a/packages/common/business_components/package.json b/packages/common/business_components/package.json index 9618ff295..eb3c0e8cb 100644 --- a/packages/common/business_components/package.json +++ b/packages/common/business_components/package.json @@ -28,6 +28,7 @@ "@common/components": "workspace:*", "@hookform/resolvers": "^4.1.3", "@radix-ui/react-label": "^2.1.2", + "@radix-ui/react-scroll-area": "^1.2.3", "@radix-ui/react-select": "^2.1.6", "@radix-ui/react-slot": "^1.1.2", "class-variance-authority": "^0.7.1", diff --git a/packages/common/business_components/src/ui/index.ts b/packages/common/business_components/src/ui/index.ts index 6bf01157c..fba8a76ad 100644 --- a/packages/common/business_components/src/ui/index.ts +++ b/packages/common/business_components/src/ui/index.ts @@ -6,4 +6,4 @@ export * from "./search_input"; export * from "./search_input_select"; export * from "./select"; export * from "./table"; - +export * from "./scroll" diff --git a/packages/common/business_components/src/ui/scroll/index.tsx b/packages/common/business_components/src/ui/scroll/index.tsx new file mode 100644 index 000000000..cf253cf17 --- /dev/null +++ b/packages/common/business_components/src/ui/scroll/index.tsx @@ -0,0 +1,46 @@ +import * as React from "react" +import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area" + +import { cn } from "@/lib/utils" + +const ScrollArea = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + + + {children} + + + + +)) +ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName + +const ScrollBar = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, orientation = "vertical", ...props }, ref) => ( + + + +)) +ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName + +export { ScrollArea, ScrollBar }