import { html } from 'lit';
import { ifDefined } from 'lit-html/directives/if-defined.js';
import { action } from 'storybook/actions';
import './Toggle.svelte';
const meta = {
    title: 'Form Elements/Toggle',
    component: 'm-toggle',
    argTypes: {
        size: {
            control: 'radio',
            options: ['s', 'm'],
        },
    },
    args: {
        id: 'ToggleId',
        label: 'Toggle Label',
    },
    render: (args) => {
        const onChange = action('change');
        const onFocus = action('focus');
        const onBlur = action('blur');
        return html `
      <m-toggle
        id=${ifDefined(args.id)}
        name=${ifDefined(args.name)}
        label=${ifDefined(args.label)}
        ?checked=${args.checked}
        ?disabled=${args.disabled}
        size=${ifDefined(args.size)}
        @change=${(event) => {
            onChange(event);
        }}
        @focus=${(event) => {
            onFocus(event);
        }}
        @blur=${(event) => {
            onBlur(event);
        }}
      ></m-toggle>
    `;
    },
};
export default meta;
export const Default = {};
export const Checked = {
    args: {
        checked: true,
        id: 'checkedId',
    },
};
export const Disabled = {
    args: {
        disabled: true,
        id: 'disabledId',
    },
};
export const Size = {
    args: {
        id: 'sizeId',
        size: 'm',
    },
};
export const HideLabel = {
    args: {
        id: 'hideLabelId',
        label: undefined,
    },
};
