import { spread } from '@open-wc/lit-helpers';
import { getStorybookHelpers } from '@wc-toolkit/storybook-helpers';
import { html } from 'lit';
import { prespread } from '../../.storybook/utilities.js';
import '../button/index.js';
import './index.js';
const { events, args, argTypes } = getStorybookHelpers('w-datepicker');
const meta = {
    title: 'Forms/Datepicker',
    render(args) {
        return html `
      <!-- Workaround for Storybook's overflow hidden -->
      <div style="min-height: 400px">
        <w-datepicker ${spread(prespread(args))}></w-datepicker>
      </div>
    `;
    },
    args,
    argTypes,
    parameters: {
        actions: {
            handles: events,
        },
    },
};
export default meta;
export const Default = {
    args: {
        label: 'Dato',
        lang: 'nb',
    },
};
export const DisableCalendarDates = {
    args: {
        label: 'Dato',
        lang: 'nb',
    },
    render(args) {
        return html `
      <!-- Workaround for Storybook's overflow hidden -->
      <div style="min-height: 400px">
        <w-datepicker ${spread(prespread(args))}></w-datepicker>
      </div>
      <script type="module">
        const datePicker = document.querySelector('w-datepicker');
        // No working on Sundays!
        datePicker.isDayDisabled = (day) => day.getDay() === 0;
      </script>
    `;
    },
};
