chore(ui): Add SearchField StartCollapsedControlled story.

Signed-off-by: Johan Persson <johanopersson@gmail.com>
This commit is contained in:
Johan Persson
2025-12-17 09:59:50 +01:00
parent dde89f7ee5
commit 3e876e1828
@@ -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>
);
},
};