import { html } from 'lit';
import { ifDefined } from 'lit-html/directives/if-defined.js';
import { action } from 'storybook/actions';
import './CheckboxGroup.svelte';
const meta = {
    title: 'Form Elements/Checkbox Group',
    component: 'm-checkbox-group',
    args: {
        name: 'checkboxGroupName',
        value: ['checkbox2'],
        options: [
            {
                id: 'checkbox-01',
                label: 'checkbox Label',
                value: 'checkbox1',
            },
            {
                id: 'checkbox-02',
                label: 'checkbox Label',
                value: 'checkbox2',
            },
            {
                id: 'checkbox-03',
                label: 'checkbox Label',
                value: 'checkbox3',
            },
            {
                id: 'checkbox-04',
                label: 'checkbox Label',
                value: 'checkbox4',
            },
        ],
    },
    render: (args) => {
        const onInput = action('input');
        const onChange = action('change');
        const onFocus = action('focus');
        const onBlur = action('blur');
        return html `
      <m-checkbox-group
        name=${ifDefined(args.name)}
        .options=${ifDefined(args.options)}
        value=${ifDefined(args.value)}
        ?isinvalid=${args.isinvalid}
        ?inline=${args.inline}
        @input=${(event) => {
            onInput(event);
        }}
        @change=${(event) => {
            onChange(event);
        }}
        @focus=${(event) => {
            onFocus(event);
        }}
        @blur=${(event) => {
            onBlur(event);
        }}
      ></m-checkbox-group>
    `;
    },
};
export default meta;
export const Default = {};
