Skip to content

Commit

Permalink
feat(libs/docs): add folder stories
Browse files Browse the repository at this point in the history
  • Loading branch information
MFarabi619 committed Dec 16, 2024
1 parent 5e615c0 commit 8002018
Showing 1 changed file with 82 additions and 0 deletions.
82 changes: 82 additions & 0 deletions libs/docs/components/ui/folder.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import type { Meta, StoryObj } from '@storybook/react'
import { File, Files, Folder } from 'fumadocs-ui/components/files'

const meta: Meta<typeof Files> = {
title: '๐Ÿ“š Docs Site/Files',
component: Files,
tags: ['autodocs'],
parameters: {
layout: 'centered',
},
argTypes: {
name: {
control: 'text',
description: 'The name of the file or folder',
},
disabled: {
control: 'boolean',
description: 'Disables the folder interaction',
defaultValue: false,
},
icon: {
control: 'object',
description: 'Optional icon component to display',
},
},
}

export default meta

type Story = StoryObj<typeof Files>

export const Default: Story = {
render: () => (
<Files>
<Folder name="app" defaultOpen>
<Folder name="[id]">
<File name="page.tsx" />
</Folder>
<File name="layout.tsx" />
<File name="page.tsx" />
<File name="global.css" />
</Folder>
<Folder name="components">
<File name="button.tsx" />
<File name="tabs.tsx" />
<File name="dialog.tsx" />
</Folder>
<File name="package.json" />
</Files>
),
}

export const FolderDisabled: Story = {
render: () => (
<Files>
<Folder name="app" disabled>
<File name="layout.tsx" />
<File name="page.tsx" />
</Folder>
<Folder name="components" disabled>
<File name="button.tsx" />
<File name="dialog.tsx" />
</Folder>
</Files>
),
}

export const CustomIcons: Story = {
render: () => (
<Files>
<Folder name="app" defaultOpen icon={<span>๐Ÿ“</span>}>
<File name="layout.tsx" icon={<span>๐Ÿ“„</span>} />
<File name="page.tsx" icon={<span>๐Ÿ“„</span>} />
</Folder>
<Folder name="components" icon={<span>โš™๏ธ</span>}>
<File name="button.tsx" icon={<span>๐Ÿ› ๏ธ</span>} />
<File name="dialog.tsx" icon={<span>๐Ÿ› ๏ธ</span>} />
</Folder>
<File name="package.json" icon={<span>๐Ÿ“ฆ</span>} />
</Files>
),
}

0 comments on commit 8002018

Please sign in to comment.