import type { Meta, StoryObj } from '@storybook/react'; import { type ChangeEvent, useCallback, useState } from 'react'; import { Checkbox, type CheckboxProps, Radio, type RadioProps, Input, type InputProps, type TextAreaProps, TextArea, Label, } from '../../../atoms'; import { ControlledSelect } from '../../../atoms/forms/fields/select/select.stories'; import { LabelledField } from './labelled-field'; const meta = { title: 'Molecules/Forms/Labelled Field', component: LabelledField, } satisfies Meta; export default meta; type Story = StoryObj; const ControlledCheckbox = ({ isChecked: checked = false, ...args }: CheckboxProps) => { const [isChecked, setIsChecked] = useState(checked); const handleChange = useCallback((e: ChangeEvent) => { setIsChecked(e.target.checked); }, []); return ; }; const ControlledInput = ({ value: defaultValue, ...args }: InputProps) => { const [value, setValue] = useState(defaultValue); const handleChange = useCallback((e: ChangeEvent) => { setValue(e.target.value); }, []); return ; }; const ControlledRadio = ({ isChecked: checked = false, ...args }: RadioProps) => { const [isChecked, setIsChecked] = useState(checked); const handleChange = useCallback((e: ChangeEvent) => { setIsChecked(e.target.checked); }, []); return ; }; const ControlledTextArea = ({ value: defaultValue, ...args }: TextAreaProps) => { const [value, setValue] = useState(defaultValue); const handleChange = useCallback((e: ChangeEvent) => { setValue(e.target.value); }, []); return