import { Meta, Preview, Props, Story } from "@storybook/addon-docs/blocks";
import { boolean, number, select, withKnobs } from "@storybook/addon-knobs";
import Tab from "../../Tab";
import TabNavigation from "../../TabNavigation";

<Meta title="Tab Navigation" component={TabNavigation} decorators={[withKnobs]} />

# Tab Navigation

## Demo

<Preview>
<Story name="Demo" parameters={{ options:{showPanel:true}}}>
  {{
    components: {
      "h-tab-navigation": TabNavigation,
      "h-tab": Tab,
    },
    template: `
      <h-tab-navigation :initialSelectedTab="initialSelectedTab" :size="size" :full="full">
        <h-tab title="One" :disabled="disabled">
          <p>Tab one</p>
        </h-tab>
        <h-tab title="Two" :disabled="disabled">
          <p>Tab two</p>
        </h-tab>
        <h-tab title="Three" :disabled="disabled">
          <p>Tab three</p>
        </h-tab>
      </h-tab-navigation>
    `,
    props: {
      initialSelectedTab: {
        default: number("initialSelectedTab", 0),
      },
      full: {
        default: boolean("full", false),
      },
      size: {
        default: select(
          "size",
          {
            XXS: "xxs",
            XS: "xs",
            S: "s",
            M: "m",
            L: "l",
            XL: "xl",
            XXL: "xxl",
          },
          "xxs",
        ),
      },
      disabled: {
        default: boolean("disabled", false),
      },
    },
  }}
</Story>
</Preview>

## Props

<Props of={TabNavigation} />
