chore(ui): Add SearchField StartCollapsedControlled story.
Signed-off-by: Johan Persson <johanopersson@gmail.com>
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { useState } from 'react';
|
||||
import type { Meta, StoryObj } from '@storybook/react-vite';
|
||||
import { SearchField } from './SearchField';
|
||||
import { Form } from 'react-aria-components';
|
||||
@@ -305,3 +306,22 @@ export const StartCollapsedWithOnChange: Story = {
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export const StartCollapsedControlled: Story = {
|
||||
args: {
|
||||
...StartCollapsed.args,
|
||||
},
|
||||
render: function Render(args) {
|
||||
const [value, setValue] = useState('');
|
||||
|
||||
return (
|
||||
<Flex
|
||||
direction="row"
|
||||
gap="2"
|
||||
style={{ width: '100%', maxWidth: '600px' }}
|
||||
>
|
||||
<SearchField {...args} size="small" value={value} onChange={setValue} />
|
||||
</Flex>
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user