import {
  Canvas,
  Meta,
  Story,
  ArgsTable
} from '@storybook/addon-docs'
import RplFormOption from './RplFormOption.vue'

export const SingleTemplate = (args) => ({
  components: { RplFormOption },
  setup() {
    return { args }
  },
  template: '<RplFormOption v-bind="args" />'
})

<Meta title='Forms/Checkbox' component={RplFormOption} />

# Forms

<ArgsTable of={RplFormOption} />

<Canvas>
  <Story
    name='Default variant'
    args={{
      id: 'checkbox-default',
      label: 'Here is a checkbox',
    }}
  >
    {SingleTemplate.bind()}
  </Story>
</Canvas>


<Canvas>
  <Story
    name='Reverse variant'
    parameters={{
      background: 'gray'
    }}
    args={{
      id: 'checkbox-reverse',
      label: 'Here is a checkbox',
      variant: 'reverse'
    }}
  >
    {SingleTemplate.bind()}
  </Story>
</Canvas>

<Canvas>
  <Story
    name='Inactive'
    args={{
      id: 'checkbox-inactive',
      label: 'Here is a checkbox',
      disabled: true,
    }}
  >
    {SingleTemplate.bind()}
  </Story>
</Canvas>


<Canvas>
  <Story
    name='Long label'
    args={{
      id: 'checkbox-long-label',
      label: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. ',
    }}
  >
    {SingleTemplate.bind()}
  </Story>
</Canvas>

<Canvas>
  <Story
    name='Custom on/off values'
    args={{
      id: 'checkbox-on-off',
      label: `I'm either 'yes' or 'no'. Check the actions tab`,
      onValue: 'yes',
      offValue: 'no',
    }}
  >
    {SingleTemplate.bind()}
  </Story>
</Canvas>


