import type { Meta, StoryObj } from '@storybook/web-components-vite'; import { html } from 'lit'; import type { USAFileInputElement } from './file-input.element.js'; // More on how to set up stories at: https://storybook.js.org/docs/writing-stories const meta = { title: 'usa-file-input', tags: ['autodocs'], argTypes: {}, args: {}, } satisfies Meta; export default meta; type Story = StoryObj; // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args export const Single: Story = { args: {}, render() { function onSubmit(e: Event) { e.preventDefault(); const data = new FormData(e.target as HTMLFormElement); console.log(data.getAll('upload')); } return html`
Input accepts a single file SUBMIT
`; }, }; export const Multiple: Story = { args: {}, render() { function onSubmit(e: Event) { e.preventDefault(); const data = new FormData(e.target as HTMLFormElement); console.log(data.getAll('upload')); } return html`
Input accepts multiple files
Drag file here or choose from folder
SUBMIT
`; }, }; export const LoadFromURL: Story = { args: {}, render() { function onSubmit(e: Event) { e.preventDefault(); const data = new FormData(e.target as HTMLFormElement); console.log(data.getAll('upload')); } return html`
Input loads default from URL
Drag file here or choose from folder
SUBMIT
`; }, };