How to use the @storybook/web-components.storiesOf function in @storybook/web-components

To help you get started, we’ve selected a few @storybook/web-components examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CleverCloud / clever-components / stories / welcome / adr.stories.js View on Github external
import { markdownToDom } from '../lib/markdown.js';
import { storiesOf } from '@storybook/web-components';

const adrReq = require.context('../../docs/adr', true, /adr.+md$/);

const adrAsStories = storiesOf('0. Welcome|Architecture Decision Records', module)
  .addParameters({
    options: {
      showPanel: false,
    },
  });

// We still use storiesOf() here because we don't want to list all ADRs statically
adrReq.keys().forEach((filename) => {
  const markdownText = adrReq(filename).default;
  const { title, element } = markdownToDom(markdownText);
  adrAsStories.add(title, () => element);
});
github CleverCloud / clever-components / stories / welcome / documentation.stories.js View on Github external
Object.entries(stories).forEach(([name, markdownText]) => {
    storiesOf(kind + '|' + name, module)
      .addParameters({
        options: { showPanel: false },
      })
      .add('Page', () => markdownToDom(markdownText).element, {
        docsOnly: true,
        docs: {
          page: () => markdownToReact(markdownText),
        },
      });
  });
}