import { html } from 'lit';
import { ifDefined } from 'lit-html/directives/if-defined.js';
import { action } from 'storybook/actions';
import './Textarea.svelte';
const meta = {
    title: 'Form Elements/Textarea',
    component: 'm-textarea',
    subcomponents: { Field: 'm-field' },
    args: {
        id: 'textareaId',
        placeholder: 'Placeholder',
    },
    render: (args) => {
        const onInput = action('input');
        const onChange = action('change');
        const onFocus = action('focus');
        const onBlur = action('blur');
        return html `
      <m-textarea
        id=${ifDefined(args.id)}
        name=${ifDefined(args.name)}
        value=${ifDefined(args.value)}
        placeholder=${ifDefined(args.placeholder)}
        ?isinvalid=${args.isinvalid}
        ?disabled=${args.disabled}
        rows=${ifDefined(args.rows)}
        minlength=${ifDefined(args.minlength)}
        maxlength=${ifDefined(args.maxlength)}
        ?readonly=${args.readonly}
        @input=${(event) => {
            onInput(event);
        }}
        @change=${(event) => {
            onChange(event);
        }}
        @focus=${(event) => {
            onFocus(event);
        }}
        @blur=${(event) => {
            onBlur(event);
        }}
      ></m-textarea>
    `;
    },
};
export default meta;
export const Value = {
    args: {
        id: 'withValueId',
        value: 'Value of the textarea component',
    },
};
export const Default = {};
export const Disabled = {
    args: {
        id: 'disabledId',
        disabled: true,
    },
};
export const ReadOnly = {
    args: {
        id: 'readonlyId',
        readonly: true,
    },
};
export const Invalid = {
    args: {
        id: 'invalidId',
        isinvalid: true,
    },
};
