@storybook/react#addParameters JavaScript Examples

The following examples show how to use @storybook/react#addParameters. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: preview.js    From virtuoso-design-system with MIT License 6 votes vote down vote up
addParameters({
  // configure storybook-design-token
  designToken: {
    files: {
      css: cssTokenFiles,
    }
  },
  docs: {
    // configure @storybook/theming
    theme: virtuosoTheme,
  },
  options: {
    // storySort: {
    //   method: 'alphabetical',
    //   order: ['Introduction', 'Basics'],
    //   locales: 'en-US',
    // },
    /**
     * id to select an addon panel
     * @type {String}
     */
    selectedPanel: 'storybook/a11y/panel',
  }
});
Example #2
Source File: config.js    From wix-style-react with MIT License 6 votes vote down vote up
// Parameters
addParameters({
  options: {
    theme,
    showPanel: false,
    isFullscreen: false,
    storySort: undefined,
    isToolshown: true,
  },
  i18n: {
    provider: ({ children }) => <React.Fragment>{children}</React.Fragment>,
    supportedLocales: ['LTR', 'RTL'],
    providerLocaleKey: 'locale',
    getDirection: locale => locale.toLowerCase(),
  },
});
Example #3
Source File: config.js    From wix-style-react with MIT License 6 votes vote down vote up
// Parameters
addParameters({
  options: {
    theme,
    showPanel: false,
    isToolshown: true,
  },
  i18n: {
    provider: ({ children }) => <React.Fragment>{children}</React.Fragment>,
    supportedLocales: ['LTR', 'RTL'],
    providerLocaleKey: 'locale',
    getDirection: locale => locale.toLowerCase(),
  },
});
Example #4
Source File: preview.js    From kube-design with MIT License 6 votes vote down vote up
addParameters({
  options: {
    /**
     * display the top-level grouping as a "root" in the sidebar
     * @type {Boolean}
     */
    showRoots: true,
  }
});
Example #5
Source File: preview.js    From lundium with MIT License 6 votes vote down vote up
addParameters({
	options: {
		storySort: {
			method: sortStories({
				Introduction: ['Welcome', 'Theming', 'Localisation'],
			}),
			order: [
				'Introduction',
				['Welcome', 'Theming', 'Localisation'],
				'Form',
				'Modals',
				'Others',
			],
		},
		showRoots: true,
	},
});
Example #6
Source File: preview.js    From storybook-documentation-primitives with MIT License 6 votes vote down vote up
addParameters({
  options: {
    showRoots: true,
  },
  repository: {
    baseUrl: 'https://github.com/DAN-AKL/storybook-documentation-primitives',
    branch: 'master',
  },
});
Example #7
Source File: preview.js    From material-ui-color with MIT License 6 votes vote down vote up
addParameters({
  options: {
    storySort: (a, b) => {
      if (a[0].includes('docs-')) {
        if (a[0].includes('intro-')) {
          return -1;
        }

        return 0;
      }

      return 1;
    }
  },
  docs: {
    container: DocsContainer,
    page: DocsPage,
  },
});
Example #8
Source File: config.js    From design-system with Apache License 2.0 5 votes vote down vote up
addParameters({
  options: {
    /**
     * show story component as full screen
     * @type {Boolean}
     */
    isFullscreen: false,
    /**
     * display panel that shows a list of stories
     * @type {Boolean}
     */
    showNav: true,
    /**
     * display panel that shows addon configurations
     * @type {Boolean}
     */
    showPanel: true,
    /**
     * where to show the addon panel
     * @type {('bottom'|'right')}
     */
    panelPosition: 'right',
    /**
     * regex for finding the hierarchy separator
     * @example:
     *   null - turn off hierarchy
     *   /\// - split by `/`
     *   /\./ - split by `.`
     *   /\/|\./ - split by `/` or `.`
     * @type {Regex}
     */
    hierarchySeparator: /\/|\./,
    /**
     * regex for finding the hierarchy root separator
     * @example:
     *   null - turn off multiple hierarchy roots
     *   /\|/ - split by `|`
     * @type {Regex}
     */
    hierarchyRootSeparator: /\|/,
    /**
     * sidebar tree animations
     * @type {Boolean}
     */
    sidebarAnimations: true,
    /**
     * enable/disable shortcuts
     * @type {Boolean}
     */
    enableShortcuts: true,
    /**
     * show/hide tool bar
     * @type {Boolean}
     */
    isToolshown: true,
    /**
     * theme storybook, see link below
     */
    theme: undefined,
    /**
     * function to sort stories in the tree view
     * common use is alphabetical `(a, b) => a[1].id.localeCompare(b[1].id)`
     * if left undefined, then the order in which the stories are imported will
     * be the order they display
     * @type {Function}
     */
    storySort: undefined,
  },
});
Example #9
Source File: config.js    From create-gatsby-web with MIT License 5 votes vote down vote up
addParameters({
  viewport: {
    viewports: {
      ...INITIAL_VIEWPORTS,
    },
  },
})
Example #10
Source File: config.js    From create-gatsby-web with MIT License 5 votes vote down vote up
addParameters({
  info: {
    inline: true,
  },
})
Example #11
Source File: config.js    From create-gatsby-web with MIT License 5 votes vote down vote up
addParameters({
  viewport: {
    viewports: {
      ...INITIAL_VIEWPORTS,
    },
  },
})
Example #12
Source File: config.js    From create-gatsby-web with MIT License 5 votes vote down vote up
addParameters({
  info: {
    inline: true,
  },
})
Example #13
Source File: manager.js    From polaris with Apache License 2.0 5 votes vote down vote up
addParameters({
  info: {
    header: false,
    inline: true,
    source: true
  }
});
Example #14
Source File: preview.js    From monday-ui-react-core with MIT License 5 votes vote down vote up
addParameters({
  controls: {
    expanded: true,
    sort: "requiredFirst"
  },
  docs: {
    inlineStories: true,
    container: ({ children, context }) => (
      <DocsContainer context={context}>
        {children}
        {<DocFooter />}
      </DocsContainer>
    ),
    page: DocsPage,
    components: {
      h1: ComponentName,
      h2: SectionName,
      h3: Title,
      li: AnchorListItem,
      a: LinkComponent,
      p: Paragraph,
      Tip,
      ComponentRules,
      UsageGuidelines,
      FunctionArguments,
      FunctionArgument,
      RelatedComponents
    }
  },
  viewMode: "docs",
  previewTabs: {
    "storybook/docs/panel": {
      index: -1
    },
    canvas: { title: "Sandbox" }
  },
  themes: {
    default: "Light",
    list: [
      { name: "Light", class: "light-app-them", color: "#ffffff" },
      { name: "Dark", class: "dark-app-theme", color: "#1C1F3B" },
      { name: "Black", class: "black-app-theme", color: "#111111" },
      { name: "Hacker", class: "hacker_theme-app-theme", color: "#282a36" }
    ]
  },
  options: {
    storySort: {
      order: [
        "Welcome",
        "Foundations",
        "Buttons",
        "Inputs",
        "Data display",
        "Media",
        "Popover",
        "Pickers",
        "*",
        "Accessibility",
        "Hooks"
      ]
    }
  }
});
Example #15
Source File: config.js    From kafka-java-vertx-starter with Apache License 2.0 5 votes vote down vote up
addParameters({
  options: {
    theme: {
      brandTitle: `ibm-messaging/kafka-java-vertx-starter UI storybook`,
      brandUrl: 'https://github.com/ibm-messaging/kafka-java-vertx-starter',
    },
  },
});
Example #16
Source File: preview.js    From taskforce-fe-components with Mozilla Public License 2.0 5 votes vote down vote up
addParameters({
  viewport: {
    viewports: INITIAL_VIEWPORTS,
  },
});
Example #17
Source File: config.js    From scalable-form-platform with MIT License 5 votes vote down vote up
addParameters({
  viewport: {}
});