From ca3544a56ba3e0e42775a461af0e636cad0f48f6 Mon Sep 17 00:00:00 2001 From: HasithDeAlwis Date: Tue, 19 Nov 2024 13:05:01 -0500 Subject: [PATCH] feat(shadcn/components/ui): create drawer stories --- .../shadcn/components/ui/drawer.stories.tsx | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 libs/external/shadcn/components/ui/drawer.stories.tsx diff --git a/libs/external/shadcn/components/ui/drawer.stories.tsx b/libs/external/shadcn/components/ui/drawer.stories.tsx new file mode 100644 index 00000000..2711fb34 --- /dev/null +++ b/libs/external/shadcn/components/ui/drawer.stories.tsx @@ -0,0 +1,107 @@ +import type { Meta, StoryObj } from '@storybook/react' +import { Button } from './button' // Importing the Button component from the same folder +import { + Drawer, + DrawerClose, + DrawerContent, + DrawerDescription, + DrawerFooter, + DrawerHeader, + DrawerTitle, + DrawerTrigger, +} from './drawer' + +const meta = { + title: 'Shadcn-ui/Drawer', + component: Drawer, + tags: ['autodocs'], + parameters: { + layout: 'centered', + }, + args: { + shouldScaleBackground: true, + }, + argTypes: { + shouldScaleBackground: { + control: 'boolean', + description: 'Determines whether the background scales when the drawer is open.', + }, + }, +} satisfies Meta + +export default meta +type Story = StoryObj + +export const Default: Story = { + render: args => ( + + + + + + + Drawer Title + + This is a description of the drawer content. + + +
+

Some main content here.

+
+ + + + + + +
+
+ ), +} + +export const Nested: Story = { + render: args => ( + + + + + + + Main Drawer + + This is the main drawer containing nested content. + + +
+

Main drawer content here.

+ + + + + + + Nested Drawer + + This is the content of the nested drawer. + + +
+

Some nested content here.

+
+ + + + + +
+
+
+ + + + + +
+
+ ), +}