import React, { useState } from 'react'; import { action } from 'storybook/actions'; import { SearchInput } from '../../src/lib/components/searchinput/SearchInput.component'; import { Wrapper, Title } from '../common'; export default { title: 'Components/Inputs/SearchInput', component: SearchInput, }; export const Default = { render: ({}) => { return ( Default
Disabled
Search Input filled
Disable the default toggle
Disable the default toggle undefined onReset action
); }, }; export const Debounce = { render: (args) => { const [value, setValue] = useState(''); return ( { setValue(e.target.value); action('debounce')(`${e.target} changed`); }} {...args} /> ); }, }; export const WithCustomIconColor = { render: (args) => { const [value, setValue] = useState(''); return ( SearchInput with Custom Icon Colors
{ setValue(e.target.value); action('on input change')(e.target.value); }} onReset={() => { setValue(''); action('on input reset')(); }} searchIconColor="infoPrimary" {...args} />
{ setValue(e.target.value); action('on input change')(e.target.value); }} onReset={() => { setValue(''); action('on input reset')(); }} searchIconColor="statusHealthy" {...args} />
{ setValue(e.target.value); action('on input change')(e.target.value); }} onReset={() => { setValue(''); action('on input reset')(); }} searchIconColor="statusWarning" {...args} />
); }, };