1import React from 'react'; 2import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; 3import { FileUpload } from '@grafana/ui'; 4import mdx from './FileUpload.mdx'; 5import { Meta, Story } from '@storybook/react'; 6 7export default { 8 title: 'Forms/FileUpload', 9 component: FileUpload, 10 decorators: [withCenteredStory], 11 parameters: { 12 docs: { 13 page: mdx, 14 }, 15 controls: { 16 exclude: ['className', 'onFileUpload'], 17 }, 18 }, 19 argTypes: { 20 size: { 21 control: { 22 type: 'select', 23 }, 24 options: ['xs', 'sm', 'md', 'lg'], 25 }, 26 }, 27} as Meta; 28 29export const Basic: Story = (args) => { 30 return ( 31 <FileUpload 32 size={args.size} 33 onFileUpload={({ currentTarget }) => console.log('file', currentTarget?.files && currentTarget.files[0])} 34 /> 35 ); 36}; 37Basic.args = { 38 size: 'md', 39}; 40