diff options
Diffstat (limited to 'src/components/molecules/buttons')
3 files changed, 96 insertions, 16 deletions
diff --git a/src/components/molecules/buttons/back-to-top.stories.tsx b/src/components/molecules/buttons/back-to-top.stories.tsx index fe58293..7d4bc39 100644 --- a/src/components/molecules/buttons/back-to-top.stories.tsx +++ b/src/components/molecules/buttons/back-to-top.stories.tsx @@ -2,6 +2,9 @@ import { ComponentMeta, ComponentStory } from '@storybook/react'; import { IntlProvider } from 'react-intl'; import BackToTopComponent from './back-to-top'; +/** + * BackToTop - Storybook Meta + */ export default { title: 'Molecules/Buttons', component: BackToTopComponent, @@ -30,14 +33,22 @@ export default { }, }, }, + decorators: [ + (Story) => ( + <IntlProvider locale="en"> + <Story /> + </IntlProvider> + ), + ], } as ComponentMeta<typeof BackToTopComponent>; const Template: ComponentStory<typeof BackToTopComponent> = (args) => ( - <IntlProvider locale="en"> - <BackToTopComponent {...args} /> - </IntlProvider> + <BackToTopComponent {...args} /> ); +/** + * Buttons Stories - Back to top + */ export const BackToTop = Template.bind({}); BackToTop.args = { target: 'top', diff --git a/src/components/molecules/buttons/heading-button.stories.tsx b/src/components/molecules/buttons/heading-button.stories.tsx index 0a23b08..b0e1465 100644 --- a/src/components/molecules/buttons/heading-button.stories.tsx +++ b/src/components/molecules/buttons/heading-button.stories.tsx @@ -3,8 +3,11 @@ import { useState } from 'react'; import { IntlProvider } from 'react-intl'; import HeadingButtonComponent from './heading-button'; +/** + * HeadingButton - Storybook Meta + */ export default { - title: 'Molecules/Buttons', + title: 'Molecules/Buttons/HeadingButton', component: HeadingButtonComponent, argTypes: { expanded: { @@ -20,6 +23,8 @@ export default { level: { control: { type: 'number', + min: 1, + max: 6, }, description: 'Heading level.', type: { @@ -48,6 +53,13 @@ export default { }, }, }, + decorators: [ + (Story) => ( + <IntlProvider locale="en"> + <Story /> + </IntlProvider> + ), + ], } as ComponentMeta<typeof HeadingButtonComponent>; const Template: ComponentStory<typeof HeadingButtonComponent> = ({ @@ -58,18 +70,64 @@ const Template: ComponentStory<typeof HeadingButtonComponent> = ({ const [isExpanded, setIsExpanded] = useState<boolean>(expanded); return ( - <IntlProvider locale="en"> - <HeadingButtonComponent - expanded={isExpanded} - setExpanded={setIsExpanded} - {...args} - /> - </IntlProvider> + <HeadingButtonComponent + expanded={isExpanded} + setExpanded={setIsExpanded} + {...args} + /> ); }; -export const HeadingButton = Template.bind({}); -HeadingButton.args = { +/** + * Heading Button Stories - Level 1 + */ +export const Level1 = Template.bind({}); +Level1.args = { + level: 1, + title: 'Your title', +}; + +/** + * Heading Button Stories - Level 2 + */ +export const Level2 = Template.bind({}); +Level2.args = { level: 2, title: 'Your title', }; + +/** + * Heading Button Stories - Level 3 + */ +export const Level3 = Template.bind({}); +Level3.args = { + level: 3, + title: 'Your title', +}; + +/** + * Heading Button Stories - Level 4 + */ +export const Level4 = Template.bind({}); +Level4.args = { + level: 4, + title: 'Your title', +}; + +/** + * Heading Button Stories - Level 5 + */ +export const Level5 = Template.bind({}); +Level5.args = { + level: 5, + title: 'Your title', +}; + +/** + * Heading Button Stories - Level 6 + */ +export const Level6 = Template.bind({}); +Level6.args = { + level: 6, + title: 'Your title', +}; diff --git a/src/components/molecules/buttons/help-button.stories.tsx b/src/components/molecules/buttons/help-button.stories.tsx index cfc1b0b..cfc603e 100644 --- a/src/components/molecules/buttons/help-button.stories.tsx +++ b/src/components/molecules/buttons/help-button.stories.tsx @@ -2,6 +2,9 @@ import { ComponentMeta, ComponentStory } from '@storybook/react'; import { IntlProvider } from 'react-intl'; import HelpButtonComponent from './help-button'; +/** + * HelpButton - Storybook Meta + */ export default { title: 'Molecules/Buttons', component: HelpButtonComponent, @@ -33,12 +36,20 @@ export default { }, }, }, + decorators: [ + (Story) => ( + <IntlProvider locale="en"> + <Story /> + </IntlProvider> + ), + ], } as ComponentMeta<typeof HelpButtonComponent>; const Template: ComponentStory<typeof HelpButtonComponent> = (args) => ( - <IntlProvider locale="en"> - <HelpButtonComponent {...args} /> - </IntlProvider> + <HelpButtonComponent {...args} /> ); +/** + * Help Button Stories - Level 1 + */ export const HelpButton = Template.bind({}); |
