2019-04-24 03:14:18 -05:00
|
|
|
import 'jquery';
|
|
|
|
import '../../../public/vendor/flot/jquery.flot.js';
|
|
|
|
import '../../../public/vendor/flot/jquery.flot.selection';
|
|
|
|
import '../../../public/vendor/flot/jquery.flot.time';
|
|
|
|
import '../../../public/vendor/flot/jquery.flot.stack';
|
|
|
|
import '../../../public/vendor/flot/jquery.flot.stackpercent';
|
|
|
|
import '../../../public/vendor/flot/jquery.flot.fillbelow';
|
|
|
|
import '../../../public/vendor/flot/jquery.flot.crosshair';
|
|
|
|
import '../../../public/vendor/flot/jquery.flot.dashes';
|
|
|
|
import '../../../public/vendor/flot/jquery.flot.gauge';
|
2019-10-21 09:39:43 -05:00
|
|
|
import { withTheme } from '../src/utils/storybook/withTheme';
|
|
|
|
import { withPaddedStory } from '../src/utils/storybook/withPaddedStory';
|
2019-03-21 10:06:55 -05:00
|
|
|
// @ts-ignore
|
|
|
|
import lightTheme from '../../../public/sass/grafana.light.scss';
|
|
|
|
// @ts-ignore
|
|
|
|
import darkTheme from '../../../public/sass/grafana.dark.scss';
|
2019-10-21 09:39:43 -05:00
|
|
|
import { configure, addDecorator, addParameters } from '@storybook/react';
|
|
|
|
import { withKnobs } from '@storybook/addon-knobs';
|
2019-01-09 02:40:57 -06:00
|
|
|
|
2019-10-21 09:39:43 -05:00
|
|
|
const handleThemeChange = (theme: any) => {
|
2019-03-21 10:06:55 -05:00
|
|
|
if (theme !== 'light') {
|
|
|
|
lightTheme.unuse();
|
|
|
|
darkTheme.use();
|
|
|
|
} else {
|
|
|
|
darkTheme.unuse();
|
|
|
|
lightTheme.use();
|
|
|
|
}
|
|
|
|
};
|
2019-01-09 02:40:57 -06:00
|
|
|
|
2019-10-21 09:39:43 -05:00
|
|
|
addDecorator(withTheme(handleThemeChange));
|
2019-02-06 10:03:42 -06:00
|
|
|
addDecorator(withKnobs);
|
2019-03-27 05:50:36 -05:00
|
|
|
addDecorator(withPaddedStory);
|
2019-02-06 10:03:42 -06:00
|
|
|
|
2019-10-21 09:39:43 -05:00
|
|
|
addParameters({
|
2020-01-30 00:49:43 -06:00
|
|
|
info: {},
|
2019-10-21 09:39:43 -05:00
|
|
|
options: {
|
|
|
|
showPanel: true,
|
2020-02-06 03:32:35 -06:00
|
|
|
showRoots: true,
|
2019-10-21 09:39:43 -05:00
|
|
|
panelPosition: 'bottom',
|
|
|
|
showNav: true,
|
|
|
|
isFullscreen: false,
|
|
|
|
isToolshown: true,
|
|
|
|
storySort: (a: any, b: any) => a[1].id.localeCompare(b[1].id),
|
|
|
|
},
|
|
|
|
knobs: {
|
|
|
|
escapeHTML: false,
|
|
|
|
},
|
|
|
|
});
|
2019-01-09 02:40:57 -06:00
|
|
|
|
2019-10-21 09:39:43 -05:00
|
|
|
// @ts-ignore
|
|
|
|
configure(require.context('../src', true, /\.story\.(js|jsx|ts|tsx|mdx)$/), module);
|