import { useState } from 'react'; import { Meta, StoryObj } from '@storybook/react-webpack5'; import { useRtlDiffI18n, withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator'; import { Input } from '../../Inputs/Input/Input'; import { TextArea } from '../../Inputs/TextArea/TextArea'; import Field, { FieldProps } from '..'; import { Sentiment } from '../../common'; const meta: Meta = { component: Field, tags: ['!autodocs', '!manifest'], title: 'Forms/Field/Tests', }; export default meta; type Story = StoryObj; export const DeprecatedProps: Story = { render: (args: FieldProps) => { const [value, setValue] = useState('This is some text'); return (
{/* instance with deprecated `hint` prop */} setValue(target.value)} /> {/* instance with deprecated `error` & `hint` props */} setValue(target.value)} /> {/* instance of info via `message` property, this is rare case (e.g MoneyInput) */} setValue(target.value)} />
); }, }; export const RTLDiff: Story = { render: () => { const i18n = useRtlDiffI18n(); return ( <>