mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Upgrade Storybook to 5.3.9 (#21550)
* Upgraded to latest stroybook. * Upgraded to version 5.3.9 * updated yarn.lock file.
This commit is contained in:
parent
9882464505
commit
6dada090b3
@ -1,2 +0,0 @@
|
||||
import '@storybook/addon-knobs/register';
|
||||
import '@storybook/addon-actions/register';
|
4
packages/grafana-ui/.storybook/main.ts
Normal file
4
packages/grafana-ui/.storybook/main.ts
Normal file
@ -0,0 +1,4 @@
|
||||
module.exports = {
|
||||
stories: ['../src/**/*.story.{js,jsx,ts,tsx,mdx}'],
|
||||
addons: ['@storybook/addon-knobs', '@storybook/addon-actions', '@storybook/addon-docs'],
|
||||
};
|
@ -1,8 +0,0 @@
|
||||
const path = require('path');
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
name: '@storybook/addon-docs/react/preset',
|
||||
options: { configureJSX: true, babelOptions: {}, sourceLoaderOptions: null },
|
||||
},
|
||||
];
|
@ -32,6 +32,7 @@ addDecorator(withKnobs);
|
||||
addDecorator(withPaddedStory);
|
||||
|
||||
addParameters({
|
||||
info: {},
|
||||
options: {
|
||||
showPanel: true,
|
||||
panelPosition: 'bottom',
|
@ -60,12 +60,12 @@
|
||||
"tinycolor2": "1.4.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/addon-actions": "5.2.4",
|
||||
"@storybook/addon-docs": "^5.2.4",
|
||||
"@storybook/addon-info": "5.2.4",
|
||||
"@storybook/addon-knobs": "5.2.4",
|
||||
"@storybook/react": "5.2.4",
|
||||
"@storybook/theming": "5.2.4",
|
||||
"@storybook/addon-actions": "5.3.9",
|
||||
"@storybook/addon-docs": "5.3.9",
|
||||
"@storybook/addon-info": "5.3.9",
|
||||
"@storybook/addon-knobs": "5.3.9",
|
||||
"@storybook/react": "5.3.9",
|
||||
"@storybook/theming": "5.3.9",
|
||||
"@types/classnames": "2.2.7",
|
||||
"@types/common-tags": "^1.8.0",
|
||||
"@types/d3": "5.7.2",
|
||||
@ -79,8 +79,6 @@
|
||||
"@types/react-custom-scrollbars": "4.0.5",
|
||||
"@types/react-test-renderer": "16.9.0",
|
||||
"@types/react-transition-group": "2.0.16",
|
||||
"@types/storybook__addon-info": "4.1.2",
|
||||
"@types/storybook__react": "4.0.2",
|
||||
"@types/tinycolor2": "1.4.1",
|
||||
"common-tags": "^1.8.0",
|
||||
"pretty-format": "24.9.0",
|
||||
|
@ -6,4 +6,4 @@ import { TabsBar } from './TabsBar'
|
||||
A composition component for rendering a TabBar with Tabs for navigation
|
||||
|
||||
|
||||
<Props of={TabBar} />
|
||||
<Props of={TabsBar} />
|
||||
|
@ -1,3 +1,4 @@
|
||||
export * from './theme';
|
||||
export * from './input';
|
||||
export * from './completion';
|
||||
export * from './storybook';
|
||||
|
2
packages/grafana-ui/src/types/storybook.ts
Normal file
2
packages/grafana-ui/src/types/storybook.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export type Renderable = React.ComponentType | JSX.Element;
|
||||
export type RenderFunction = () => Renderable | Renderable[];
|
@ -28,8 +28,8 @@ export function getPreviousCousin(node: any, selector: string) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export function getNextCharacter(global = window) {
|
||||
const selection = global.getSelection();
|
||||
export function getNextCharacter(global?: any) {
|
||||
const selection = (global || window).getSelection();
|
||||
if (!selection || !selection.anchorNode) {
|
||||
return null;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { RenderFunction } from '@storybook/react';
|
||||
import { RenderFunction } from '../../types';
|
||||
|
||||
interface CenteredStoryProps {
|
||||
children: React.ReactNode;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { RenderFunction } from '@storybook/react';
|
||||
import { RenderFunction } from '../../types';
|
||||
|
||||
const PaddedStory: React.FunctionComponent<{}> = ({ children }) => {
|
||||
return (
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { RenderFunction } from '@storybook/react';
|
||||
import { RenderFunction } from '../../types';
|
||||
|
||||
const RightAlignedStory: React.FunctionComponent<{}> = ({ children }) => {
|
||||
return (
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { RenderFunction } from '@storybook/react';
|
||||
import { boolean, number } from '@storybook/addon-knobs';
|
||||
import { css, cx } from 'emotion';
|
||||
import { RenderFunction } from '../../types';
|
||||
|
||||
const StoryContainer: React.FC<{ width?: number; showBoundaries: boolean }> = ({ children, width, showBoundaries }) => {
|
||||
const checkColor = '#f0f0f0';
|
||||
|
@ -1,9 +1,9 @@
|
||||
import React from 'react';
|
||||
import { RenderFunction } from '@storybook/react';
|
||||
import { ThemeContext } from '../../themes/ThemeContext';
|
||||
import { select } from '@storybook/addon-knobs';
|
||||
import { getTheme } from '../../themes/index';
|
||||
import { GrafanaThemeType } from '@grafana/data';
|
||||
import { RenderFunction } from '../../types';
|
||||
|
||||
type SassThemeChangeHandler = (theme: GrafanaThemeType) => void;
|
||||
const ThemableStory: React.FunctionComponent<{ handleSassThemeChange: SassThemeChangeHandler }> = ({
|
||||
|
Loading…
Reference in New Issue
Block a user