diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-04-14 22:14:35 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-04-14 22:14:35 +0200 |
| commit | 88b575b0d81e97531b70e90c1e124719b547614b (patch) | |
| tree | 67a9b196b44c26e56310cf2338c7192b96807ec0 /src/components/organisms/toolbar/search.stories.tsx | |
| parent | b94b9b41f113da17f232a7d1044dedadd87e0c89 (diff) | |
chore: add a Search component
Diffstat (limited to 'src/components/organisms/toolbar/search.stories.tsx')
| -rw-r--r-- | src/components/organisms/toolbar/search.stories.tsx | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/src/components/organisms/toolbar/search.stories.tsx b/src/components/organisms/toolbar/search.stories.tsx new file mode 100644 index 0000000..8c2e871 --- /dev/null +++ b/src/components/organisms/toolbar/search.stories.tsx @@ -0,0 +1,63 @@ +import { ComponentMeta, ComponentStory } from '@storybook/react'; +import { useState } from 'react'; +import { IntlProvider } from 'react-intl'; +import SearchComponent from './search'; + +export default { + title: 'Organisms/Toolbar', + component: SearchComponent, + argTypes: { + className: { + control: { + type: 'text', + }, + description: 'Set additional classnames to the modal wrapper.', + table: { + category: 'Styles', + }, + type: { + name: 'string', + required: false, + }, + }, + isActive: { + control: { + type: null, + }, + description: 'Define the modal state: either opened or closed.', + type: { + name: 'boolean', + required: true, + }, + }, + setIsActive: { + control: { + type: null, + }, + description: 'A callback function to update modal state.', + type: { + name: 'function', + required: true, + }, + }, + }, +} as ComponentMeta<typeof SearchComponent>; + +const Template: ComponentStory<typeof SearchComponent> = ({ + isActive, + setIsActive: _setIsActive, + ...args +}) => { + const [isOpen, setIsOpen] = useState<boolean>(isActive); + + return ( + <IntlProvider locale="en"> + <SearchComponent isActive={isOpen} setIsActive={setIsOpen} {...args} /> + </IntlProvider> + ); +}; + +export const Search = Template.bind({}); +Search.args = { + isActive: false, +}; |
