mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-11 10:23:54 +00:00
1849b4d39f
* chore: migrate eslint to oxlint * chore: migrate prettier to oxfmt * chore: migrate typescript * chore: toThrow should have a expected value * chore: cast test value as Day * chore: small title fix * chore: mocks should be hoisted * chore: incorrect async useage * chore: test should be inside description * chore: test sohuld include an expeced * chore: oxfmt --------- Co-authored-by: alex-Arc <omnivox@LAPTOP-RC5SNBVV.localdomain>
39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
import { ScrollArea } from '@base-ui/react/scroll-area';
|
|
import { CSSProperties, PropsWithChildren, Ref } from 'react';
|
|
|
|
import { cx } from '../../utils/styleUtils';
|
|
|
|
import style from './ScrollArea.module.scss';
|
|
|
|
interface ScrollAreaProps {
|
|
className?: string;
|
|
viewportClassName?: string;
|
|
contentClassName?: string;
|
|
contentStyle?: CSSProperties;
|
|
ref?: Ref<HTMLDivElement>;
|
|
orientation?: 'vertical' | 'horizontal';
|
|
}
|
|
|
|
export default function StyledScrollArea({
|
|
className,
|
|
viewportClassName,
|
|
contentClassName,
|
|
contentStyle,
|
|
children,
|
|
ref,
|
|
orientation = 'vertical',
|
|
}: PropsWithChildren<ScrollAreaProps>) {
|
|
return (
|
|
<ScrollArea.Root className={cx([style.root, className])}>
|
|
<ScrollArea.Viewport ref={ref} className={cx([style.viewport, viewportClassName])}>
|
|
<ScrollArea.Content className={contentClassName} style={contentStyle}>
|
|
{children}
|
|
</ScrollArea.Content>
|
|
</ScrollArea.Viewport>
|
|
<ScrollArea.Scrollbar className={style.scrollbar} orientation={orientation}>
|
|
<ScrollArea.Thumb className={style.thumb} />
|
|
</ScrollArea.Scrollbar>
|
|
</ScrollArea.Root>
|
|
);
|
|
}
|