import type { Meta, StoryObj } from '@storybook/react-webpack5'; import { useState } from 'react'; import { createSandboxStory, globalScope, } from '../../../../.storybook/components/sandbox/SandboxEditor'; import { Size } from '../../../common'; import Field from '../../../Field'; import { SearchInput } from '../SearchInput'; export default { component: SearchInput, title: 'Forms/SearchInput', } satisfies Meta; type Story = StoryObj; export const Sandbox = createSandboxStory({ code: `const App = () => { const [value, setValue] = React.useState(''); return ( setValue(event.currentTarget.value)} /> ); };`, scope: globalScope, }); export const Basic: Story = { render: (args) => , args: { size: Size.MEDIUM, shape: 'pill', disabled: false, }, argTypes: { onChange: { action: 'changed', }, }, decorators: [ (Story) => ( ), ], }; function SearchInputBasic({ onChange, ...restProps }: NonNullable) { const [value, setValue] = useState('Text value'); return ( { setValue(event.currentTarget.value); onChange?.(event); }} /> ); }