Commit d784accd by Dominik Prokop

Add storybook script to run it from root dir

parent a21f6777
...@@ -116,7 +116,8 @@ ...@@ -116,7 +116,8 @@
"typecheck": "tsc --noEmit", "typecheck": "tsc --noEmit",
"jest": "jest --notify --watch", "jest": "jest --notify --watch",
"api-tests": "jest --notify --watch --config=tests/api/jest.js", "api-tests": "jest --notify --watch --config=tests/api/jest.js",
"precommit": "grunt precommit" "precommit": "grunt precommit",
"storybook": "cd packages/grafana-ui && yarn storybook"
}, },
"husky": { "husky": {
"hooks": { "hooks": {
......
import React from 'react'; import React from 'react';
import { storiesOf } from '@storybook/react'; import { storiesOf } from '@storybook/react';
import { withKnobs } from '@storybook/addon-knobs'; import { withKnobs } from '@storybook/addon-knobs';
import SpectrumPalette from './SpectrumPalette'; import SpectrumPalette from './SpectrumPalette';
import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
import { UseState } from '../../utils/storybook/UseState'; import { UseState } from '../../utils/storybook/UseState';
...@@ -11,8 +10,9 @@ const SpectrumPaletteStories = storiesOf('UI/ColorPicker/Palettes/SpectrumPalett ...@@ -11,8 +10,9 @@ const SpectrumPaletteStories = storiesOf('UI/ColorPicker/Palettes/SpectrumPalett
SpectrumPaletteStories.addDecorator(withCenteredStory).addDecorator(withKnobs); SpectrumPaletteStories.addDecorator(withCenteredStory).addDecorator(withKnobs);
SpectrumPaletteStories.add('Named colors swatch - support for named colors', () => { SpectrumPaletteStories.add('default', () => {
const selectedTheme = getThemeKnob(); const selectedTheme = getThemeKnob();
return ( return (
<UseState initialState="red"> <UseState initialState="red">
{(selectedColor, updateSelectedColor) => { {(selectedColor, updateSelectedColor) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment