From 0f936ec0e7606cb79434d94096b6e113a7ce78eb Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 15 Dec 2023 18:35:16 +0100 Subject: refactor(stories): migrate stories to CSF3 format --- .../forms/search-form/search-form.stories.ts | 30 ++++++++++++++ .../forms/search-form/search-form.stories.tsx | 46 ---------------------- 2 files changed, 30 insertions(+), 46 deletions(-) create mode 100644 src/components/organisms/forms/search-form/search-form.stories.ts delete mode 100644 src/components/organisms/forms/search-form/search-form.stories.tsx (limited to 'src/components/organisms/forms/search-form') diff --git a/src/components/organisms/forms/search-form/search-form.stories.ts b/src/components/organisms/forms/search-form/search-form.stories.ts new file mode 100644 index 0000000..203d4a6 --- /dev/null +++ b/src/components/organisms/forms/search-form/search-form.stories.ts @@ -0,0 +1,30 @@ +import type { Meta, StoryObj } from '@storybook/react'; +import { SearchForm, type SearchFormSubmit } from './search-form'; + +const meta = { + component: SearchForm, + title: 'Organisms/Forms/Search', +} satisfies Meta; + +export default meta; + +type Story = StoryObj; + +const search: SearchFormSubmit = () => { + console.log('Searching!'); + + return undefined; +}; + +export const Example: Story = { + args: { + onSubmit: search, + }, +}; + +export const WithLabelHidden: Story = { + args: { + isLabelHidden: true, + onSubmit: search, + }, +}; diff --git a/src/components/organisms/forms/search-form/search-form.stories.tsx b/src/components/organisms/forms/search-form/search-form.stories.tsx deleted file mode 100644 index d8e4339..0000000 --- a/src/components/organisms/forms/search-form/search-form.stories.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import type { ComponentMeta, ComponentStory } from '@storybook/react'; -import { SearchForm } from './search-form'; - -/** - * SearchForm - Storybook Meta - */ -export default { - title: 'Organisms/Forms/Search', - component: SearchForm, - argTypes: { - isLabelHidden: { - control: { - type: 'boolean', - }, - description: 'Determine if the input label should be visually hidden.', - table: { - category: 'Options', - defaultValue: { summary: false }, - }, - type: { - name: 'boolean', - required: false, - }, - }, - }, -} as ComponentMeta; - -const Template: ComponentStory = (args) => ( - -); - -/** - * SearchForm Stories - Default - */ -export const Default = Template.bind({}); -Default.args = { - isLabelHidden: false, -}; - -/** - * SearchForm Stories - With hidden label - */ -export const WithHiddenLabel = Template.bind({}); -WithHiddenLabel.args = { - isLabelHidden: true, -}; -- cgit v1.2.3