import { ImageSquare } from '@phosphor-icons/react'; import { colorsFlattened } from '@shared/util/themeColors'; import type { Meta, StoryObj } from '@storybook/react'; import FileUpload from '@views/components/common/FileUpload'; import React from 'react'; /** * Stole this straight from Button.stories.tsx to test the input */ const meta = { title: 'Components/Common/FileUpload', component: FileUpload, parameters: { layout: 'centered', }, tags: ['autodocs'], args: { children: 'Upload File', icon: ImageSquare, }, argTypes: { children: { control: 'text' }, color: { control: 'select', options: Object.keys(colorsFlattened), }, variant: { control: 'select', options: ['filled', 'outline', 'single'], }, disabled: { control: 'boolean', }, onChange: { action: 'file selected' }, // action to show when file is selected }, } satisfies Meta; export default meta; type Story = StoryObj; export const Default: Story = { args: { variant: 'filled', color: 'ut-black', // Default theme color }, }; export const Small: Story = { // @ts-ignore args: { children: '', }, render: props => (
Upload File Upload File Upload File

), }; export const Mini: Story = { // @ts-ignore args: { children: '', }, render: props => (
Button Button Button

), }; export const Disabled: Story = { args: { variant: 'filled', color: 'ut-black', disabled: true, }, }; // @ts-ignore export const Grid: Story = { render: props => (

), }; export const PrettyColors: Story = { // @ts-ignore args: { children: '', }, render: props => { const colorsNames = Object.keys(colorsFlattened) as (keyof typeof colorsFlattened)[]; return (
{colorsNames.map(color => (
Button Button Button
))}
); }, };