kibana/packages/kbn-storybook/lib/register.ts
Nathan L Smith 3a020c3998
Storybook theme switcher (#97201)
Allow switching the EUI theme in the Storybook menu bar.
2021-05-06 15:25:05 -05:00

27 lines
992 B
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { addons } from '@storybook/addons';
import { create } from '@storybook/theming';
import { registerThemeSwitcherAddon } from './register_theme_switcher_addon';
// This configures the "Manager", or main outer view of Storybook. It is an
// addon that's loaded by the `managerEntries` part of the preset in ../preset.js.
addons.setConfig({
theme: create({
base: 'light',
brandTitle: 'Kibana Storybook',
brandUrl: 'https://github.com/elastic/kibana/tree/master/packages/kbn-storybook',
}),
showPanel: false,
isFullscreen: false,
panelPosition: 'bottom',
isToolshown: true,
});
registerThemeSwitcherAddon();