@carbonid1/design-system 5.12.0 → 5.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ScrollAreaContentProps, ScrollAreaCornerProps, ScrollAreaRootProps, ScrollAreaScrollbarProps, ScrollAreaThumbProps, ScrollAreaViewportProps } from './ScrollArea.types';
|
|
2
|
+
export declare const ScrollArea: {
|
|
3
|
+
Root: ({ className, ...props }: ScrollAreaRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
Viewport: ({ className, ...props }: ScrollAreaViewportProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
Content: ({ className, ...props }: ScrollAreaContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
Scrollbar: ({ className, orientation, ...props }: ScrollAreaScrollbarProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
Thumb: ({ className, ...props }: ScrollAreaThumbProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
Corner: ({ className, ...props }: ScrollAreaCornerProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { ScrollArea as BaseScrollArea } from '@base-ui/react/scroll-area';
|
|
4
|
+
import { cn } from '../helpers/cn/cn';
|
|
5
|
+
const scrollbarClasses = 'm-1 flex touch-none select-none justify-center rounded-full opacity-0 transition-opacity delay-100 duration-150 data-[hovering]:delay-0 data-[hovering]:opacity-100 data-[scrolling]:opacity-100 motion-reduce:transition-none';
|
|
6
|
+
const Root = ({ className, ...props }) => (_jsx(BaseScrollArea.Root, { className: cn('relative overflow-hidden', className), ...props }));
|
|
7
|
+
const Viewport = ({ className, ...props }) => (_jsx(BaseScrollArea.Viewport, { className: cn('focus-visible:ring-ring/50 h-full w-full overscroll-contain rounded-[inherit] outline-hidden focus-visible:ring-2', className), ...props }));
|
|
8
|
+
const Content = ({ className, ...props }) => (_jsx(BaseScrollArea.Content, { className: cn(className), ...props }));
|
|
9
|
+
const Scrollbar = ({ className, orientation = 'vertical', ...props }) => (_jsx(BaseScrollArea.Scrollbar, { orientation: orientation, className: cn(scrollbarClasses, orientation === 'vertical' && 'w-1.5', orientation === 'horizontal' && 'h-1.5 flex-col', className), ...props }));
|
|
10
|
+
const Thumb = ({ className, ...props }) => (_jsx(BaseScrollArea.Thumb, { className: cn('bg-muted-foreground/30 rounded-full data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full', className), ...props }));
|
|
11
|
+
const Corner = ({ className, ...props }) => (_jsx(BaseScrollArea.Corner, { className: cn('bg-transparent', className), ...props }));
|
|
12
|
+
export const ScrollArea = {
|
|
13
|
+
Root,
|
|
14
|
+
Viewport,
|
|
15
|
+
Content,
|
|
16
|
+
Scrollbar,
|
|
17
|
+
Thumb,
|
|
18
|
+
Corner,
|
|
19
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ScrollAreaContentProps as BaseContentProps, ScrollAreaCornerProps as BaseCornerProps, ScrollAreaRootProps as BaseRootProps, ScrollAreaScrollbarProps as BaseScrollbarProps, ScrollAreaThumbProps as BaseThumbProps, ScrollAreaViewportProps as BaseViewportProps } from '@base-ui/react/scroll-area';
|
|
2
|
+
import type { Ref } from 'react';
|
|
3
|
+
export type ScrollAreaRootProps = BaseRootProps & {
|
|
4
|
+
ref?: Ref<HTMLDivElement>;
|
|
5
|
+
};
|
|
6
|
+
export type ScrollAreaViewportProps = BaseViewportProps & {
|
|
7
|
+
ref?: Ref<HTMLDivElement>;
|
|
8
|
+
};
|
|
9
|
+
export type ScrollAreaContentProps = BaseContentProps & {
|
|
10
|
+
ref?: Ref<HTMLDivElement>;
|
|
11
|
+
};
|
|
12
|
+
export type ScrollAreaScrollbarProps = BaseScrollbarProps & {
|
|
13
|
+
ref?: Ref<HTMLDivElement>;
|
|
14
|
+
};
|
|
15
|
+
export type ScrollAreaThumbProps = BaseThumbProps & {
|
|
16
|
+
ref?: Ref<HTMLDivElement>;
|
|
17
|
+
};
|
|
18
|
+
export type ScrollAreaCornerProps = BaseCornerProps & {
|
|
19
|
+
ref?: Ref<HTMLDivElement>;
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ export { ProgressRing } from './ProgressRing/ProgressRing';
|
|
|
11
11
|
export { Slider } from './Slider/Slider';
|
|
12
12
|
export { SegmentedControl } from './SegmentedControl/SegmentedControl';
|
|
13
13
|
export type { SegmentedControlItemProps, SegmentedControlRootProps, SegmentedControlSize, } from './SegmentedControl/SegmentedControl.types';
|
|
14
|
+
export { ScrollArea } from './ScrollArea/ScrollArea';
|
|
15
|
+
export type { ScrollAreaContentProps, ScrollAreaCornerProps, ScrollAreaRootProps, ScrollAreaScrollbarProps, ScrollAreaThumbProps, ScrollAreaViewportProps, } from './ScrollArea/ScrollArea.types';
|
|
14
16
|
export { ContextMenu } from './ContextMenu/ContextMenu';
|
|
15
17
|
export { Menu } from './Menu/Menu';
|
|
16
18
|
export { Dialog } from './Dialog/Dialog';
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export { Text, textVariants } from './Text/Text';
|
|
|
6
6
|
export { ProgressRing } from './ProgressRing/ProgressRing';
|
|
7
7
|
export { Slider } from './Slider/Slider';
|
|
8
8
|
export { SegmentedControl } from './SegmentedControl/SegmentedControl';
|
|
9
|
+
export { ScrollArea } from './ScrollArea/ScrollArea';
|
|
9
10
|
export { ContextMenu } from './ContextMenu/ContextMenu';
|
|
10
11
|
export { Menu } from './Menu/Menu';
|
|
11
12
|
export { Dialog } from './Dialog/Dialog';
|