UNPKG

@szum-tech/design-system

Version:

Szum-Tech design system with tailwindcss support

44 lines (41 loc) 1.51 kB
import { cn } from './chunk-ZD2QRAOX.js'; import { ScrollArea as ScrollArea$1 } from 'radix-ui'; import { jsx, jsxs } from 'react/jsx-runtime'; function ScrollBar({ className, orientation = "vertical", ...props }) { return /* @__PURE__ */ jsx( ScrollArea$1.ScrollAreaScrollbar, { "data-slot": "scroll-area-scrollbar", 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" : "", className ), ...props, children: /* @__PURE__ */ jsx( ScrollArea$1.ScrollAreaThumb, { "data-slot": "scroll-area-thumb", className: "bg-border relative flex-1 rounded" } ) } ); } function ScrollArea({ className, children, ...props }) { return /* @__PURE__ */ jsxs(ScrollArea$1.Root, { "data-slot": "scroll-area", className: cn("relative", className), ...props, children: [ /* @__PURE__ */ jsx( ScrollArea$1.Viewport, { "data-slot": "scroll-area-viewport", className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring focus-visible:outline-1", children } ), /* @__PURE__ */ jsx(ScrollBar, {}), /* @__PURE__ */ jsx(ScrollArea$1.Corner, {}) ] }); } export { ScrollArea, ScrollBar };