import type { Meta, StoryObj } from "@storybook/react" import { ScrollArea } from "./ScrollArea" /** * Provides a custom scrollable area with styled scrollbars. * * ## Props * - `scrollbars`: "vertical" | "horizontal" | "both" (default: "both") * - `radius`: "none" | "small" | "medium" | "large" | "full" * - `size`: "1" | "2" | "3" (default: "1") * - `asChild`: boolean */ const meta = { title: "base/containment/ScrollArea", component: ScrollArea, tags: ["autodocs"], argTypes: { scrollbars: { control: "select", options: ["vertical", "horizontal", "both"], description: "Which scrollbars to show", }, radius: { control: "select", options: ["none", "small", "medium", "large", "full"], description: "Border radius of the scroll area", }, size: { control: "select", options: ["1", "2", "3"], description: "Size of the scroll area", }, }, parameters: { layout: "centered", }, args: { style: { width: 300, height: 200 }, }, } satisfies Meta export default meta type Story = StoryObj /** * Basic scroll area with long content. */ export const Default: Story = { render: args => (

Scrollable Content

{Array.from({ length: 20 }, (_, i) => (

Content item {i + 1}

This is some additional text to make the content longer and demonstrate scrolling.

))}
), } /** * Scroll area with different sizes. */ export const Sizes: Story = { render: () => (

Small (1)

{Array.from({ length: 10 }, (_, i) => (
Item {i + 1}
))}

Medium (2)

{Array.from({ length: 10 }, (_, i) => (

Item {i + 1}

Additional content

))}

Large (3)

{Array.from({ length: 10 }, (_, i) => (

Item {i + 1}

More detailed content

))}
), } /** * Scroll area with different scrollbar configurations. */ export const ScrollbarTypes: Story = { render: () => (

Vertical Only

{Array.from({ length: 15 }, (_, i) => (

Section {i + 1}

This content is long enough to require vertical scrolling.

))}

Horizontal Only

{Array.from({ length: 10 }, (_, i) => (

Card {i + 1}

This card has a fixed width to demonstrate horizontal scrolling.

))}

Both (Default)

{Array.from({ length: 8 }, (_, i) => (
{Array.from({ length: 5 }, (_, j) => (
Item {i + 1}-{j + 1}
))}
))}
), } /** * Scroll area with different border radius. */ export const BorderRadius: Story = { render: () => (

No Radius

{Array.from({ length: 8 }, (_, i) => (
Item {i + 1}
))}

Small Radius

{Array.from({ length: 8 }, (_, i) => (
Item {i + 1}
))}

Medium Radius

{Array.from({ length: 8 }, (_, i) => (
Item {i + 1}
))}

Large Radius

{Array.from({ length: 8 }, (_, i) => (
Item {i + 1}
))}
), } /** * Code editor example. */ export const CodeEditor: Story = { render: () => (
function{" "} calculateSum( a, b){" "} {"{"}
return a + b;
{"}"}
const{" "} result = calculateSum( 5, 10 );
console.log(result);{" "} {"// 15"}
class{" "} Calculator {"{"}
constructor() {"{"}
this. history = [];
{"}"}
add(a, b) {"{"}
const result = a + b;
this.history.push({"{"} a, b, result {"}"});
return result;
{"}"}
{"}"}
const{" "} calc ={" "} new Calculator();
calc.add(3,{" "} 7);{" "} {"// 10"}
), } /** * Chat interface example. */ export const ChatInterface: Story = { render: () => (

Hey! How are you doing today?

I'm doing great, thanks for asking! How about you?

Pretty good! Working on some new features.

That sounds exciting! What kind of features?

Mostly UI improvements and performance optimizations.

Can't wait to see them in action!

Thanks! I'll keep you updated on the progress.

Perfect! Looking forward to it.

), } /** * File browser example. */ export const FileBrowser: Story = { render: () => (
📁 Documents
📄 report.pdf
📄 presentation.pptx
📁 Projects
📁 Pictures
🖼️ vacation.jpg
🖼️ family.png
📁 Music
🎵 song1.mp3
🎵 song2.mp3
🎵 song3.mp3
📁 Downloads
📦 setup.exe
📄 manual.pdf
), }