import type { Meta, StoryObj } from '@storybook/react-vite'; import { Controller, useForm } from 'react-hook-form'; import { Button } from './Button'; import { TextField } from './TextField'; const meta: Meta = { component: TextField, parameters: { layout: 'centered', }, tags: ['autodocs'], argTypes: {}, args: { label: 'Name', }, }; export default meta; type Story = StoryObj; export const Example: Story = {}; export const HtmlValidation: Story = { render: (args) => (
{ event.preventDefault(); }} className="flex flex-col items-start gap-2" > ), }; export const ReactHookFormValidation: Story = { render: (args) => { // eslint-disable-next-line react-hooks/rules-of-hooks const { control, handleSubmit } = useForm({ defaultValues: { name: '', }, }); return (
( )} /> ); }, }; HtmlValidation.args = { isRequired: true, };