import { Meta, Preview, Props, Story } from "@storybook/addon-docs/blocks";
import { select, withKnobs } from "@storybook/addon-knobs";
import Text from "../../Text";

<Meta title="Text" component={Text} decorators={[withKnobs]} />

# Text

Some MDX docs for the `Text` component.

## Demo

<Preview>
  <Story name="Demo" parameters={{
    docs: {
      disable: true
    },
    options: {
      showPanel: true
    }
  }}>
    {{
      components: {
        "h-text": Text,
      },
      props: {
        as: {
          default: select(
            "as",
            {
              "<b>": "b",
              "<blockquote>": "blockquote",
              "<code>": "code",
              "<del>": "del",
              "<em>": "em",
              "<i>": "i",
              "<ins>": "ins",
              "<mark>": "mark",
              "<p>": "p",
              "<pre>": "pre",
              "<q>": "q",
              "<s>": "s",
              "<small>": "small",
              "<span>": "span",
              "<strong>": "strong",
              "<sub>": "sub",
              "<u>": "u"
            },
            "p"
          ),
        },
        type: {
          default: select(
            "type",
            {
              None: null,
              body: "body",
              paragraph: "paragraph",
              "paragraph bold": "paragraph-bold",
              small: "small",
              "small bold": "small-bold",
              tiny: "tiny",
              "tiny bold": "tiny-bold",
              label: "label",
            },
            "body"
          ),
        },
      },
      template: `<h-text :as="as" :type="type">Text</h-text>`,
    }}
  </Story>
</Preview>

<Preview>
  <Story name="Levels" parameters={{
    docs: {
      disable: false
    },
    options: {
      showPanel: false
    }
  }}>
    {{
      components: {
        "h-text": Text,
      },
      template: `
        <div>
          <h-text as="bold">Bold</h-text>
          <h-text as="blockquote">Blockquote</h-text>
          <h-text as="code">Code</h-text>
          <h-text as="del">Deleted</h-text>
          <h-text as="em">Emphasized</h-text>
          <h-text as="i">Italic</h-text>
          <h-text as="ins">Inserted</h-text>
          <h-text as="mark">Marked</h-text>
          <h-text as="p">Paragraph</h-text>
          <h-text as="pre">Preformatted</h-text>
          <h-text as="q">Quotation</h-text>
          <h-text as="s">Strikethrough</h-text>
          <h-text as="small">Small</h-text>
          <h-text as="span">Span</h-text>
          <h-text as="strong">Strong</h-text>
          <h-text as="sub">Subscript</h-text>
          <h-text as="u">Underline</h-text>
        </div>
      `,
    }}
  </Story>
</Preview>

## Props

<Props of={Text} />
