import React, { useState } from 'react' import { type Meta, type StoryObj } from '@storybook/react' import { SearchField } from '../index' const meta = { title: 'Components/SearchField', component: SearchField, args: { labelText: 'Search field', }, } satisfies Meta export default meta type Story = StoryObj export const Playground: Story = { render: (args) => { const [value, setValue] = useState('Some value') return ( setValue(e.target.value)} onClear={(): void => setValue('')} {...args} /> ) }, parameters: { docs: { canvas: { sourceState: 'shown', }, }, }, } export const Secondary: Story = { args: { secondary: true, }, } export const Disabled: Story = { args: { disabled: true, }, } export const Reversed: Story = { render: () => (
), decorators: [ (Story) => (
), ], parameters: { docs: { source: { type: 'dynamic' } } }, }