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