mirror of
https://github.com/hanzoai/o11y-components.git
synced 2026-10-30 14:54:15 +00:00
62 lines
1.4 KiB
TypeScript
62 lines
1.4 KiB
TypeScript
import {
|
|
Button,
|
|
ButtonColor,
|
|
ButtonVariant,
|
|
Drawer,
|
|
DrawerClose,
|
|
DrawerContent,
|
|
DrawerDescription,
|
|
DrawerFooter,
|
|
DrawerHeader,
|
|
DrawerTitle,
|
|
DrawerTrigger,
|
|
} from '@signozhq/ui';
|
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
import { closeArgTypes } from './shared/dialog-drawer-arg-types.js';
|
|
|
|
const meta: Meta<typeof DrawerClose> = {
|
|
title: 'Primitive Components/Drawer/DrawerClose',
|
|
component: DrawerClose,
|
|
argTypes: closeArgTypes,
|
|
parameters: {
|
|
layout: 'fullscreen',
|
|
},
|
|
tags: ['autodocs'],
|
|
};
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof DrawerClose>;
|
|
|
|
export const Default: Story = {
|
|
args: {
|
|
asChild: true,
|
|
},
|
|
render: (args) => (
|
|
<Drawer>
|
|
<DrawerTrigger asChild>
|
|
<Button variant={ButtonVariant.Solid} color={ButtonColor.Primary}>
|
|
Open drawer
|
|
</Button>
|
|
</DrawerTrigger>
|
|
<DrawerContent>
|
|
<DrawerHeader>
|
|
<DrawerTitle>Drawer with custom close</DrawerTitle>
|
|
</DrawerHeader>
|
|
<DrawerDescription>
|
|
This drawer uses DrawerClose in the footer for the close action.
|
|
</DrawerDescription>
|
|
<DrawerFooter>
|
|
<Button variant={ButtonVariant.Ghost} color="secondary">
|
|
Cancel
|
|
</Button>
|
|
<DrawerClose {...args}>
|
|
<Button variant={ButtonVariant.Solid} color={ButtonColor.Primary}>
|
|
Close
|
|
</Button>
|
|
</DrawerClose>
|
|
</DrawerFooter>
|
|
</DrawerContent>
|
|
</Drawer>
|
|
),
|
|
};
|