import { useState } from 'react'; import type { Meta, StoryObj } from '@storybook/react-vite'; import { StringField } from './StringField.tsx'; import type { PasswordStrengthValue } from './StringFieldPassword.tsx'; type Story = StoryObj; export default { component: StringField } as Meta; export const Short: Story = { decorators: [ (Story) => { const [value, setValue] = useState(); return ( ); } ] }; export const TextArea: Story = { decorators: [ (Story) => { const [value, setValue] = useState(); return ( ); } ] }; export const Password: Story = { decorators: [ (Story) => { const [value, setValue] = useState(); return ( ); } ] }; export const PasswordWithStrength: Story = { decorators: [ (Story) => { const [value, setValue] = useState(); return ( { return Math.min(password.length, 4) as PasswordStrengthValue; }, description: 'Lorem ipsum dolor sit amet consectetur adipisicing elit.', label: 'Password', name: 'text', setValue, value, variant: 'password' }} /> ); } ] }; export const Select: Story = { decorators: [ (Story) => { const [value, setValue] = useState(); return ( ); } ] };