import { html } from 'lit';
import { ifDefined } from 'lit-html/directives/if-defined.js';
import { action } from 'storybook/actions';
import './PasswordInput.svelte';
const meta = {
    title: 'Form Elements/PasswordInput',
    component: 'm-password-input',
    subcomponents: { Field: 'm-field' },
    args: {
        id: 'passwordInputId',
        placeholder: 'Enter your password',
    },
    render: (args) => {
        const onInput = action('input');
        const onChange = action('change');
        const onFocus = action('focus');
        const onBlur = action('blur');
        return html `
      <m-password-input
        id=${ifDefined(args.id)}
        name=${ifDefined(args.name)}
        value=${ifDefined(args.value)}
        placeholder=${ifDefined(args.placeholder)}
        ?isinvalid=${args.isinvalid}
        ?disabled=${args.disabled}
        ?readonly=${args.readonly}
        ?isclearable=${args.isclearable}
        clearlabel=${ifDefined(args.clearlabel)}
        @input=${(event) => {
            onInput(event);
        }}
        @change=${(event) => {
            onChange(event);
        }}
        @focus=${(event) => {
            onFocus(event);
        }}
        @blur=${(event) => {
            onBlur(event);
        }}
      ></m-password-input>
    `;
    },
};
export default meta;
export const Value = {
    args: {
        id: 'withValueId',
        value: 'Magic-word-123',
    },
};
export const Default = {};
export const Clearable = {
    args: {
        id: 'clearableId',
        value: 'Magic-word-123',
        isclearable: true,
    },
};
export const Disabled = {
    args: {
        id: 'disableId',
        disabled: true,
    },
};
export const ReadOnly = {
    args: {
        id: 'readonlyId',
        readonly: true,
    },
};
export const Invalid = {
    args: {
        id: 'invalidId',
        isinvalid: true,
    },
};
