import { action } from "@storybook/addon-actions";
import { Meta, Preview, Props, Story } from "@storybook/addon-docs/blocks";
import Card from "../../Card";
import Button from "../../Button";
import IconBasket from "../../Icons/IconBasket";
import IconDelete from "../../Icons/IconDelete";
import { DEMASK, PACIFIC } from "../../../utils/colors";
import StorybookContainer from "../../../shared/StorybookContainer";

<Meta title="Cards" />

# Cards

<Story name="Demo" parameters={{ docs:{disable: true}, options:{showPanel:true}}}>
    {{
        components: { Button, Card, IconBasket, IconDelete, StorybookContainer },
  methods: {
    onCancel: action("Cancel"),
    onAdd: action("Added to basket"),
    onDelete: action("Deleted"),
  },
  template: `
    <StorybookContainer style="flex-wrap: wrap;">
      <Card style="width: 328px;height: 264px;margin: 16px;">
          <div style="display: flex; justify-content: center; align-items: center; flex-direction: column;">
            <span style="display: flex; padding: 16px; margin-bottom: 8px; border-radius: 50%; background-color: #f4f4f4;">
              <IconDelete fill="${PACIFIC}" :width="32" :height="32" />
            </span>
            <h5 class="u-font-size-h5 u-color-fiord">Add to basket</h5>
          </div>
        <p class="u-font-size-small" style="text-align: center; margin: 8px 0 24px;">Your parcel details have successfully been validated. Would you like to add your shipment(s) to the basket?</p>
          <div style="display: flex;">
            <Button id="button-1" ariaLabel="Button 1" color="white" @click.native="onCancel" style="width: 100%; margin-right: 8px;">Cancel</Button>
            <Button id="button-2" ariaLabel="Button 2" color="pacific" @click.native="onAdd" style="width: 100%; margin-left: 8px;">Add to basket</Button>
          </div>
      </Card>
     <Card style="width: 328px;height: 264px;margin: 16px;">
          <div style="display: flex; justify-content: center; align-items: center; flex-direction: column;">
            <span style="display: flex; padding: 16px; margin-bottom: 8px; border-radius: 50%; background-color: #f4f4f4;">
              <IconBasket fill="${DEMASK}" :width="32" :height="32" />
            </span>
            <h5 class="u-font-size-h5 u-color-fiord">Delete parcel</h5>
          </div>
        <p class="u-font-size-small" style="text-align: center; margin: 8px 0 24px;">Deleting your parcel will permanently remove it from your shipments</p>
          <div style="display: flex;">
            <Button id="button-3" ariaLabel="Button 3" color="white" @click.native="onCancel" style="width: 100%; margin-right: 8px;">Cancel</Button>
            <Button id="button-4" ariaLabel="Button 4" color="pacific" @click.native="onDelete" style="width: 100%; margin-left: 8px;">Delete</Button>
          </div>
      </Card>
<Card style="width: 328px;height: 264px;margin: 16px;" :disabled="true">
          <div style="display: flex; justify-content: center; align-items: center; flex-direction: column;">
            <span style="display: flex; padding: 16px; margin-bottom: 8px; border-radius: 50%; background-color: #f4f4f4;">
              <IconDelete fill="${PACIFIC}" :width="32" :height="32" />
            </span>
            <h5 class="u-font-size-h5 u-color-fiord">Add to basket</h5>
          </div>
        <p class="u-font-size-small" style="text-align: center; margin: 8px 0 24px;">Your parcel details have successfully been validated. Would you like to add your shipment(s) to the basket?</p>
          <div style="display: flex;">
            <Button id="button-5" ariaLabel="Button 5" color="white" @click.native="onCancel" style="width: 100%; margin-right: 8px;">Cancel</Button>
            <Button id="button-6" ariaLabel="Button 6" color="pacific" @click.native="onAdd" style="width: 100%; margin-left: 8px;">Add to basket</Button>
          </div>
      </Card>
      <Card style="width: 328px;height: 264px;margin: 16px;" :disabled="true">
          <div style="display: flex; justify-content: center; align-items: center; flex-direction: column;">
            <span style="display: flex; padding: 16px; margin-bottom: 8px; border-radius: 50%; background-color: #f4f4f4;">
              <IconBasket fill="${DEMASK}" :width="32" :height="32" />
            </span>
            <h5 class="u-font-size-h5 u-color-fiord">Delete parcel</h5>
          </div>
        <p class="u-font-size-small" style="text-align: center; margin: 8px 0 24px;">Deleting your parcel will permanently remove it from your shipments</p>
          <div style="display: flex;">
            <Button id="button-7" ariaLabel="Button 7" color="white" @click.native="onCancel" style="width: 100%; margin-right: 8px;">Cancel</Button>
            <Button id="button-8" ariaLabel="Button 8" color="pacific" @click.native="onDelete" style="width: 100%; margin-left: 8px;">Delete</Button>
          </div>
      </Card>
      <Card class="test" headerClass="c-card__header" footerClass="c-card__footer">
        <template slot="header"><h1>TestCard</h1></template>
        <p>Here is some content</p>
        <template slot="footer"><sub>footer</sub></template>
      </Card>
    </StorybookContainer>
  `,
    }}
</Story>

## Properties

<Props of={ Card } />
