How to use the @storybook/vue.configure function in @storybook/vue

To help you get started, we’ve selected a few @storybook/vue 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 dpc-sdp / ripple / packages / ripple-ui-components / .storybook / config.js View on Github external
// Install Ripple Global plugin
Vue.use(RplGlobal, { rplMarkup: {plugins: RplMarkupExamplePlugins, options: { decodeEntities: false }}})

setOptions({
  name: 'Ripple',
  downPanelInRight: true,
})

// automatically import all files ending in *.stories.js
const req = require.context('../components', true, /.stories.js$/);
function loadStories() {
  req.keys().forEach((filename) => req(filename));
  require('../src/storybook-components/stories');
}

configure(loadStories, module)
github milad-alizadeh / vue-cli-plugin-atomic-design / generator / template / config / storybook / config.js View on Github external
// Require all the .stories.js files from all components
const req = require.context('@/components', true, /.stories.js$/)

function loadStories () {
  req.keys().forEach((filePath) => {
    const componentName = filePath.replace(/^.+\/([^/]+)\/index.stories.js/, '$1')
    const component = req(filePath)
    Vue.component(componentName, component)
    return component
  })
}

addDecorator(StoryRouter())

configure(loadStories, module)
github almeynman / typescript-vue-storybook-tutorial / .storybook / config.js View on Github external
import { configure } from "@storybook/vue";

// automatically import all files ending in *.stories.js
const req = require.context("../src/stories", true, /.stories.ts$/);
function loadStories() {
  req.keys().forEach(filename => req(filename));
}

configure(loadStories, module);
github storybookjs / storybook / lib / cli / generators / VUE / template-mdx / .storybook / config.js View on Github external
import { configure } from '@storybook/vue';

// automatically import all files ending in *.stories.js
configure(require.context('../stories', true, /\.stories\.(js|mdx)$/), module);
github dpc-sdp / ripple / src / .storybook / config.js View on Github external
// Disable Docs globally for now until we got time to update them.
    // We are still able to add Docs in component level.
    // https://github.com/storybookjs/storybook/blob/next/addons/docs/docs/docspage.md#replacing-docspage
    page: null
  },
  backgrounds: [
    // We need a story background color which is different with all SDP theme color,
    // so we can tell if a component has the right background color.
    { name: 'light', value: '#edfafc', default: true }
  ],
})

// Install Ripple Global plugin
Vue.use(RplGlobal, { rplMarkup: {plugins: RplMarkupExamplePlugins, options: { decodeEntities: false }}})

configure(require.context('./../../packages/components', true, /(stories\.js|mdx)$/), module)
github tuchk4 / storybook-readme / packages / example-vue / .storybook / config.js View on Github external
theme: basicTheme,
    // theme: themes.dark,
  },
  readme: {
    // You can set the global code theme here.
    codeTheme: 'github',
  },
});

addDecorator(addReadme);

function loadStories() {
  require('../stories');
}

configure(loadStories, module);
github JosephusPaye / Keen-UI / .storybook / config.js View on Github external
import { configure } from '@storybook/vue';

// CSS reset expected by Keen UI
import './css/reset.css';

// Utilities for use in global decorators
import './css/utilities.css';

// Bootstrap modality
import '../src/bootstrap';

// Load all files ending in *.stories.js
configure(require.context('../stories', true, /\.stories\.js$/), module);
github dawg / vusic / config / storybook / config.js View on Github external
import { configure } from '@storybook/vue';
import storybook from '../../src/storybook';

storybook();

function loadStories() {
  // TODO REMOVE
}

configure(loadStories, module);
github ulaval / modul-components / conf / storybook / config.jest.ts View on Github external
function Module(file): any {
        return require(file);
    }

    Module.keys = () => Object.keys(files);

    return Module;
};

const loadJestStories: any = () => {
    const req: any = requireContext('../../src', true, /\.stories\.ts$/);
    req.keys().forEach(filename => req(filename));
};

configure(() => loadJestStories(), module);
github gitlabhq / gitlabhq / .storybook / config.js View on Github external
name: 'GitLab EE',
  url: 'https://gitlab.com/gitlab-org/gitlab-ee/',
  goFullScreen: false,
  showLeftPanel: true,
  showDownPanel: true,
  showSearchBox: false,
  downPanelInRight: true,
  sortStoriesByKind: false,
  hierarchySeparator: /\./,
});

function loadStories() {
  require('../stories')
}

configure(loadStories, module)