import { Meta, Preview, Props, Story } from "@storybook/addon-docs/blocks";
import DescriptiveRadioButton from "../../DescriptiveRadioButton";
import ParcelShopOpen from "../../../assets/images/parcelshop-open.svg";
import CourierCollection from "../../../assets/images/hermes-courier.svg";
import { descriptiveRadioButtonData, descriptiveRadioButtonTemplate } from "./DescriptiveRadioButton.data.js";

<Meta title="DescriptiveRadioButton" component={DescriptiveRadioButton} />

# DescriptiveRadioButton

Some MDX docs for the `DescriptiveRadioButton` component.

## Demo

<Story name="Demo" parameters={{options:{showNav:true}}}>
  {{
    components: {
      DescriptiveRadioButton,
    },
    props: {
      buttons: {
        default: [
          {
            name: "parcelshop",
            title: "ParcelShop or Locker drop off",
            subtitle: "Delivery in 2-3 working days from drop off",
            image: ParcelShopOpen,
            supportingText: "Your nearest drop off is <a href='https://google.co.uk' target='_blank'>0.8 miles away</a>",
            value: "parcelshop",
          },
          {
            name: "courier",
            title: "Courier Collection",
            subtitle: "Delivery in 3-4 working days from collection",
            image: CourierCollection,
            supportingText: "Collection from tomorrow <strong>between 8am-8pm</strong>",
            value: "courier",
          },
        ],
      },
    },
    template: descriptiveRadioButtonTemplate,
    data() {
      return {
        value: "",
        ParcelShopOpen,
        CourierCollection
      }
    }
  }}
</Story>

## Code example

~~~
<h-descriptive-radio-button :buttons="buttons" v-model="value"/>
~~~

## Props example

~~~
//In the buttons prop, only name, title and value are required.

buttons: [
  {
    name: "parcelshop",
    title: "ParcelShop or Locker drop off",
    subtitle: "Delivery in 2-3 working days from drop off",
    image: ParcelShopOpen,
    supportingText: "Your nearest drop off is <a href='https://google.co.uk' target='_blank'>0.8 miles away</a>",
    value: "parcelshop",
  },
  {
    name: "courier",
    title: "Courier Collection",
    subtitle: "Delivery in 3-4 working days from collection",
    image: CourierCollection,
    supportingText: "Collection from tomorrow <strong>between 8am-8pm</strong>",
    value: "courier",
  },
  {
    name: "courier2",
    title: "Courier Collection",
    subtitle: "Delivery in 3-4 working days from collection",
    image: CourierCollection,
    supportingText: "Collection from tomorrow <strong>between 8am-8pm</strong>",
    value: "courier2",
    disabled: true,
  },
]
~~~

### Props

<Props of={DescriptiveRadioButton} />
