import { Meta, Preview, Props, Story } from "@storybook/addon-docs/blocks";
import { action } from "@storybook/addon-actions";
import { boolean, text, withKnobs } from "@storybook/addon-knobs";
import Drawer from "../../Drawer";
import { DEMASK } from "../../../utils/colors";
import StorybookContainer from "../../../shared/StorybookContainer";
import { drawerActions, drawerTemplate } from "./Drawer.data.js";

<Meta title="Drawer" component={Drawer} decorators={[withKnobs]} />

# Drawer

Some MDX docs for the `Drawer` component.

## Demo

<Preview>
  <Story name="Demo" parameters={{options:{showPanel:true}}}>
    {{
      components: {
        "h-drawer": Drawer,
        StorybookContainer,
      },
      props: {
        show: {
          default: boolean("show", false)
        },
        title: {
          default: text("title", "Drawer title")
        },
      },
      data() {
        return {
          showDrawer: false,
        };
      },
      template: `
        <StorybookContainer>
          <button @click.prevent="toggleDrawer">Open Drawer</button>
          <h-drawer v-model="showDrawer" :title="title" />
        </StorybookContainer>
      `,
      methods: {
        toggleDrawer() {
          this.showDrawer = !this.showDrawer;
        },
      },
    }}
  </Story>
</Preview>

## Props

<Props of={Drawer} />
