diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-11-22 19:07:25 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-11-23 11:44:28 +0100 |
| commit | 4f1181581e177dd80a76165a0f930ef4577f9c6a (patch) | |
| tree | 6029f86d42af7700f5b59cd1477854190bab65c6 /src/components/atoms/layout/section/section.stories.tsx | |
| parent | 329e7c89bac50be9db2c6d2ec6751ab0ffad42ac (diff) | |
refactor(components): integrate sectioned page template into Page
* replace Section component by a generic one (other components should
be able to use it)
* add a PageSection component
* add `hasSections` prop to Page component
* remove sectioned-page template
Diffstat (limited to 'src/components/atoms/layout/section/section.stories.tsx')
| -rw-r--r-- | src/components/atoms/layout/section/section.stories.tsx | 66 |
1 files changed, 9 insertions, 57 deletions
diff --git a/src/components/atoms/layout/section/section.stories.tsx b/src/components/atoms/layout/section/section.stories.tsx index e21209b..fdc8217 100644 --- a/src/components/atoms/layout/section/section.stories.tsx +++ b/src/components/atoms/layout/section/section.stories.tsx @@ -1,85 +1,37 @@ import type { ComponentMeta, ComponentStory } from '@storybook/react'; import { Heading } from '../../heading'; -import { Section } from './section'; +import { Section as SectionComponent } from './section'; /** * Section - Storybook Meta */ export default { title: 'Atoms/Layout/Section', - component: Section, - args: { - hasBorder: true, - variant: 'light', - }, + component: SectionComponent, argTypes: { children: { - description: 'The section content.', + description: 'The section contents.', type: { name: 'function', required: true, }, }, - hasBorder: { - control: { - type: 'boolean', - }, - description: 'Add a border at the bottom of the section.', - table: { - category: 'Styles', - defaultValue: { summary: false }, - }, - type: { - name: 'boolean', - required: false, - }, - }, - variant: { - control: { - type: 'select', - }, - description: 'The section variant.', - options: ['light', 'dark'], - table: { - category: 'Styles', - defaultValue: { summary: 'dark' }, - }, - type: { - name: 'string', - required: false, - }, - }, }, -} as ComponentMeta<typeof Section>; +} as ComponentMeta<typeof SectionComponent>; -const Template: ComponentStory<typeof Section> = (args) => ( - <Section {...args} /> +const Template: ComponentStory<typeof SectionComponent> = (args) => ( + <SectionComponent {...args} /> ); /** - * Section Stories - Light - */ -export const Light = Template.bind({}); -Light.args = { - children: ( - <> - <Heading level={2}>A section title</Heading> - <div>The body</div> - </> - ), - variant: 'light', -}; - -/** - * Section Stories - Dark + * Section Story */ -export const Dark = Template.bind({}); -Dark.args = { +export const Section = Template.bind({}); +Section.args = { children: ( <> <Heading level={2}>A section title</Heading> <div>The body</div> </> ), - variant: 'dark', }; |
