import { html } from 'lit';
import { ifDefined } from 'lit-html/directives/if-defined.js';
import { action } from 'storybook/actions';
import './Pincode.svelte';
const meta = {
    title: 'Form Elements/Pincode',
    component: 'm-pincode',
    subcomponents: { Field: 'm-field' },
    tags: ['v2'],
    argTypes: {
        length: {
            control: {
                type: 'number',
                min: 4,
                max: 6,
            },
        },
        input: {
            control: false,
        },
    },
    args: {
        id: 'pincodeId',
    },
    render: (args) => {
        const onInput = action('input');
        const onFocus = action('focus');
        const onBlur = action('blur');
        return html `
      <m-pincode
        id=${ifDefined(args.id)}
        name=${ifDefined(args.name)}
        value=${ifDefined(args.value)}
        length=${ifDefined(args.length)}
        ?isinvalid=${args.isinvalid}
        ?disabled=${args.disabled}
        ?readonly=${args.readonly}
        @input=${(event) => {
            onInput(event);
        }}
        @focus=${(event) => {
            onFocus(event);
        }}
        @blur=${(event) => {
            onBlur(event);
        }}
      ></m-pincode>
    `;
    },
};
export default meta;
export const Value = {
    args: {
        id: 'valueId',
        value: '123098',
    },
};
export const Default = {};
export const Disabled = {
    args: {
        id: 'disableId',
        disabled: true,
    },
};
export const ReadOnly = {
    args: {
        id: 'readonlyId',
        value: '123098',
        readonly: true,
    },
};
export const Invalid = {
    args: {
        id: 'invalidId',
        isinvalid: true,
    },
};
