Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

feat(stories): Migration to CSF format - FRONT-1117 #489

Merged
merged 4 commits into from
Jul 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions src/ec/packages/ec-component-accordion/accordion.story.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { storiesOf } from '@storybook/html';
import { withKnobs, text, select, optionsKnob } from '@storybook/addon-knobs';
import { withNotes } from '@ecl-twig/storybook-addon-notes';
import {
Expand Down Expand Up @@ -46,10 +45,17 @@ const prepareAccordion = data => {
return data;
};

storiesOf('Components/deprecated/Accordion', module)
.addDecorator(withKnobs)
.addDecorator(withCode)
.addDecorator(withNotes)
.add('ECL < 2.6.0 - default', () => accordion(prepareAccordion(demoData)), {
export default {
title: 'Components/deprecated/Accordion',
decorators: [withKnobs, withCode, withNotes],
};

export const Default = () => accordion(prepareAccordion(demoData));

Default.story = {
name: 'ECL < 2.6.0 - default',

parameters: {
notes: { markdown: notes, json: demoData },
});
},
};
20 changes: 13 additions & 7 deletions src/ec/packages/ec-component-accordion2/accordion2.story.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { storiesOf } from '@storybook/html';
import { withKnobs, text, select, optionsKnob } from '@storybook/addon-knobs';
import { withNotes } from '@ecl-twig/storybook-addon-notes';
import {
Expand Down Expand Up @@ -45,10 +44,17 @@ const prepareAccordion2 = data => {
return data;
};

storiesOf('Components/Accordion2', module)
.addDecorator(withKnobs)
.addDecorator(withCode)
.addDecorator(withNotes)
.add('default', () => accordion2(prepareAccordion2(demoData)), {
export default {
title: 'Components/Accordion2',
decorators: [withKnobs, withCode, withNotes],
};

export const Default = () => accordion2(prepareAccordion2(demoData));

Default.story = {
name: 'default',

parameters: {
notes: { markdown: notes, json: demoData },
});
},
};
20 changes: 13 additions & 7 deletions src/ec/packages/ec-component-blockquote/blockquote.story.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { storiesOf } from '@storybook/html';
import { withKnobs, text } from '@storybook/addon-knobs';
import { withNotes } from '@ecl-twig/storybook-addon-notes';
import withCode from '@ecl-twig/storybook-addon-code';
Expand All @@ -23,10 +22,17 @@ const prepareQuote = data => {
return data;
};

storiesOf('Components/Blockquote', module)
.addDecorator(withKnobs)
.addDecorator(withCode)
.addDecorator(withNotes)
.add('default', () => blockquote(prepareQuote(defaultData)), {
export default {
title: 'Components/Blockquote',
decorators: [withKnobs, withCode, withNotes],
};

export const Default = () => blockquote(prepareQuote(defaultData));

Default.story = {
name: 'default',

parameters: {
notes: { markdown: notes, json: defaultData },
});
},
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { storiesOf } from '@storybook/html';
import { withNotes } from '@ecl-twig/storybook-addon-notes';
import { withKnobs, text, optionsKnob } from '@storybook/addon-knobs';
import withCode from '@ecl-twig/storybook-addon-code';
Expand Down Expand Up @@ -42,13 +41,27 @@ const prepareBreadcrumbCore = data => {
return data;
};

storiesOf('Components/Navigation/Breadcrumbs/Breadcrumb Core', module)
.addDecorator(withNotes)
.addDecorator(withCode)
.addDecorator(withKnobs)
.add('simple', () => breadcrumb(prepareBreadcrumbCore(dataSimple)), {
export default {
title: 'Components/Navigation/Breadcrumbs/Breadcrumb Core',
decorators: [withNotes, withCode, withKnobs],
};

export const Simple = () => breadcrumb(prepareBreadcrumbCore(dataSimple));

Simple.story = {
name: 'simple',

parameters: {
notes: { markdown: notes, json: dataSimple },
})
.add('long', () => breadcrumb(prepareBreadcrumbCore(dataLong)), {
},
};

export const Long = () => breadcrumb(prepareBreadcrumbCore(dataLong));

Long.story = {
name: 'long',

parameters: {
notes: { markdown: notes, json: dataLong },
});
},
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { storiesOf } from '@storybook/html';
import { withNotes } from '@ecl-twig/storybook-addon-notes';
import withCode from '@ecl-twig/storybook-addon-code';
import { withKnobs, text, optionsKnob } from '@storybook/addon-knobs';
Expand Down Expand Up @@ -42,13 +41,27 @@ const prepareBreadcrumbHarmonised = data => {
return data;
};

storiesOf('Components/Navigation/Breadcrumbs/Breadcrumb Harmonised', module)
.addDecorator(withNotes)
.addDecorator(withCode)
.addDecorator(withKnobs)
.add('simple', () => breadcrumb(prepareBreadcrumbHarmonised(dataSimple)), {
export default {
title: 'Components/Navigation/Breadcrumbs/Breadcrumb Harmonised',
decorators: [withNotes, withCode, withKnobs],
};

export const Simple = () => breadcrumb(prepareBreadcrumbHarmonised(dataSimple));

Simple.story = {
name: 'simple',

parameters: {
notes: { markdown: notes, json: dataSimple },
})
.add('long', () => breadcrumb(prepareBreadcrumbHarmonised(dataLong)), {
},
};

export const Long = () => breadcrumb(prepareBreadcrumbHarmonised(dataLong));

Long.story = {
name: 'long',

parameters: {
notes: { markdown: notes, json: dataLong },
});
},
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { storiesOf } from '@storybook/html';
import { withNotes } from '@ecl-twig/storybook-addon-notes';
import withCode from '@ecl-twig/storybook-addon-code';
import { withKnobs, text, optionsKnob } from '@storybook/addon-knobs';
Expand Down Expand Up @@ -42,13 +41,28 @@ const prepareBreadcrumbStandardised = data => {
return data;
};

storiesOf('Components/Navigation/Breadcrumbs/Breadcrumb Standardised', module)
.addDecorator(withNotes)
.addDecorator(withCode)
.addDecorator(withKnobs)
.add('simple', () => breadcrumb(prepareBreadcrumbStandardised(dataSimple)), {
export default {
title: 'Components/Navigation/Breadcrumbs/Breadcrumb Standardised',
decorators: [withNotes, withCode, withKnobs],
};

export const Simple = () =>
breadcrumb(prepareBreadcrumbStandardised(dataSimple));

Simple.story = {
name: 'simple',

parameters: {
notes: { markdown: notes, json: dataSimple },
})
.add('long', () => breadcrumb(prepareBreadcrumbStandardised(dataLong)), {
},
};

export const Long = () => breadcrumb(prepareBreadcrumbStandardised(dataLong));

Long.story = {
name: 'long',

parameters: {
notes: { markdown: notes, json: dataLong },
});
},
};
31 changes: 22 additions & 9 deletions src/ec/packages/ec-component-breadcrumb/breadcrumb.story.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { storiesOf } from '@storybook/html';
import { withKnobs, text, optionsKnob } from '@storybook/addon-knobs';
import { withNotes } from '@ecl-twig/storybook-addon-notes';
import withCode from '@ecl-twig/storybook-addon-code';
Expand Down Expand Up @@ -42,13 +41,27 @@ const prepareBreadcrumb = data => {
return data;
};

storiesOf('Components/Navigation/Breadcrumb', module)
.addDecorator(withKnobs)
.addDecorator(withNotes)
.addDecorator(withCode)
.add('simple', () => breadcrumb(prepareBreadcrumb(dataSimple)), {
export default {
title: 'Components/Navigation/Breadcrumb',
decorators: [withKnobs, withNotes, withCode],
};

export const Simple = () => breadcrumb(prepareBreadcrumb(dataSimple));

Simple.story = {
name: 'simple',

parameters: {
notes: { markdown: notes, json: dataSimple },
})
.add('long', () => breadcrumb(prepareBreadcrumb(dataLong)), {
},
};

export const Long = () => breadcrumb(prepareBreadcrumb(dataLong));

Long.story = {
name: 'long',

parameters: {
notes: { markdown: notes, json: dataLong },
});
},
};
Loading