How to use @storybook/ember - 10 common examples

To help you get started, we’ve selected a few @storybook/ember 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 hashicorp / vault / ui / stories / home-link.stories.js View on Github external
/* eslint-disable import/extensions */
import hbs from 'htmlbars-inline-precompile';
import { storiesOf } from '@storybook/ember';
import notes from './home-link.md';

storiesOf('HomeLink/', module)
  .addParameters({ options: { showPanel: false } })
  .add(
    'HomeLink',
    () => ({
      template: hbs`
        <h5 class="title is-5">HomeLink</h5>
        
        <br>
        <h5 class="title is-5">HomeLink with LogoEdition</h5>
        
          
        
    `,
    }),
    { notes }
  );
github hashicorp / vault / ui / stories / alert-banner.stories.js View on Github external
/* eslint-disable import/extensions */
import hbs from 'htmlbars-inline-precompile';
import { storiesOf } from '@storybook/ember';
import notes from './alert-banner.md';
import { MESSAGE_TYPES } from '../lib/core/addon/helpers/message-types.js';


storiesOf('Alerts/AlertBanner/', module)
  .addParameters({ options: { showPanel: false } })
  .add(
    'AlertBanner',
    () =&gt; ({
      template: hbs`
      {{#each types as |type|}}
        <h5 class="title is-5">{{humanize type}}</h5>
        
      {{/each}}
    `,
      context: {
        types: Object.keys(MESSAGE_TYPES),
        message: 'Here is a message.',
      },
    }),
    { notes }
github hashicorp / vault / ui / .storybook / config.js View on Github external
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
import theme from './theme.js';
import { assign } from '@ember/polyfills';

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

addParameters({
  viewport: { viewports: INITIAL_VIEWPORTS },
  options: { theme },
});

addDecorator(storyFn => {
  const { template, context } = storyFn();

  // This adds styling to the Canvas tab.
  const styles = {
    style: {
      margin: '20px',
    },
  };

  // Create a div to wrap the Canvas tab with the applied styles.
  const element = document.createElement('div');
  assign(element.style, styles.style);

  const innerElement = document.createElement('div');
  const wormhole = document.createElement('div');
  wormhole.setAttribute('id', 'ember-basic-dropdown-wormhole');
github storybookjs / storybook / examples / ember-cli / .storybook / config.js View on Github external
import { load, addParameters } from '@storybook/ember';

addParameters({
  options: {
    hierarchySeparator: /\/|\./,
    hierarchyRootSeparator: /\|/,
  },
});

// FIXME require('../stories/index.stories');
load(require.context('../stories', true, /\.stories\.js$/), module);
github hashicorp / vault / ui / lib / core / stories / confirm-action.stories.js View on Github external
import hbs from 'htmlbars-inline-precompile';
import { storiesOf } from '@storybook/ember';
import { withKnobs, text, boolean } from '@storybook/addon-knobs';
import notes from './confirm-action.md';

storiesOf('Confirm/ConfirmAction', module)
  .addParameters({ options: { showPanel: true } })
  .addDecorator(
    withKnobs({
      escapeHTML: false,
    })
  )
  .add(
    `ConfirmAction`,
    () =&gt; ({
      template: hbs`
        <h5 class="title is-5">Confirm Action</h5>
github hashicorp / vault / ui / lib / core / stories / message-error.stories.js View on Github external
import hbs from 'htmlbars-inline-precompile';
import { storiesOf } from '@storybook/ember';
import notes from './message-error.md';
import EmberObject from '@ember/object';

let model = EmberObject.create({
  adapterError: {
    message: 'This is an adapterError on the model',
  },
  isError: true,
});

storiesOf('MessageError', module)
  .addParameters({ options: { showPanel: true } })
  .add(
    `MessageError`,
    () =&gt; ({
      template: hbs`
      <h5 class="title is-5">Message Error</h5>
      
    `,
      context: {
        model,
      },
    }),
    { notes }
  );
github hashicorp / vault / ui / lib / core / stories / layout-loading.stories.js View on Github external
import hbs from 'htmlbars-inline-precompile';
import { storiesOf } from '@storybook/ember';
import notes from './layout-loading.md';

storiesOf('LayoutLoading', module)
  .addParameters({ options: { showPanel: true } })
  .add(
    `LayoutLoading`,
    () =&gt; ({
      template: hbs`
        <h5 class="title is-5">Layout Loading</h5>
        
    `,
      context: {},
    }),
    { notes }
  );
github hashicorp / vault / ui / stories / http-requests-container.stories.js View on Github external
const COUNTERS = [
  { start_time: '2017-04-01T00:00:00Z', total: 5500 },
  { start_time: '2018-06-01T00:00:00Z', total: 4500 },
  { start_time: '2018-07-01T00:00:00Z', total: 4500 },
  { start_time: '2018-08-01T00:00:00Z', total: 6500 },
  { start_time: '2018-09-01T00:00:00Z', total: 5500 },
  { start_time: '2018-10-01T00:00:00Z', total: 4500 },
  { start_time: '2018-11-01T00:00:00Z', total: 6500 },
  { start_time: '2018-12-01T00:00:00Z', total: 5500 },
  { start_time: '2019-01-01T00:00:00Z', total: 2500 },
  { start_time: '2019-02-01T00:00:00Z', total: 3500 },
  { start_time: '2019-03-01T00:00:00Z', total: 5000 },
];

storiesOf('HttpRequests/HttpRequestsContainer', module)
  .addParameters({ options: { showPanel: true } })
  .addDecorator(withKnobs())
  .add(
    `HttpRequestsContainer`,
    () =&gt; ({
      template: hbs`
        <h5 class="title is-5">Http Requests Container</h5>
        
    `,
      context: {
        counters: object('counters', COUNTERS),
      },
    }),
    { notes }
  );
github hashicorp / vault / ui / stories / auth-form.stories.js View on Github external
import hbs from 'htmlbars-inline-precompile';
import { storiesOf } from '@storybook/ember';
import notes from './auth-form.md';

storiesOf('AuthForm', module)
  .addParameters({ options: { showPanel: false } })
  .add(
    `AuthForm`,
    () =&gt; ({
      template: hbs`
        <h5 class="title is-5">Auth Form</h5>
        
    `,
      context: {},
    }),
    { notes }
  );
github hashicorp / vault / ui / lib / core / stories / search-select.stories.js View on Github external
import hbs from 'htmlbars-inline-precompile';
import { storiesOf } from '@storybook/ember';
import notes from './search-select.md';
import { withKnobs, text } from '@storybook/addon-knobs';

const onChange = value =&gt; alert(`New value is "${value}"`);
const models = ['identity/groups'];

storiesOf('SearchSelect', module)
  .addParameters({ options: { showPanel: true } })
  .addDecorator(withKnobs({ escapeHTML: false }))
  .add(
    `SearchSelect`,
    () =&gt; ({
      template: hbs`
      <h5 class="title is-5">Search Select</h5>
      
    `,

@storybook/ember

Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.

MIT
Latest version published 3 days ago

Package Health Score

93 / 100
Full package analysis