Skip to content

Commit

Permalink
Prototype of generating style guide + snapshot tests from *.info.js
Browse files Browse the repository at this point in the history
  • Loading branch information
tlrobinson committed Apr 11, 2017
1 parent 08c5252 commit ed89a26
Show file tree
Hide file tree
Showing 26 changed files with 777 additions and 867 deletions.
1 change: 0 additions & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[ignore]
.*/node_modules/react/node_modules/.*
.*/node_modules/postcss-import/node_modules/.*
.*/node_modules/@kadira/storybook/node_modules/.*
.*/node_modules/.*/\(lib\|test\).*\.json$

[include]
Expand Down
7 changes: 0 additions & 7 deletions .reduxrc

This file was deleted.

7 changes: 0 additions & 7 deletions .storybook/config.js

This file was deleted.

34 changes: 0 additions & 34 deletions .storybook/webpack.config.js

This file was deleted.

14 changes: 14 additions & 0 deletions frontend/src/metabase/components/Button.info.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from "react";
import Button from "metabase/components/Button";

export const component = Button;

export const description = `
Metabase's main button component.
`;

export const examples = {
"": <Button>Clickity click</Button>,
"primary": <Button primary>Clickity click</Button>,
"with an icon": <Button icon='star'>Clickity click</Button>
};
14 changes: 14 additions & 0 deletions frontend/src/metabase/components/CheckBox.info.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from "react";
import CheckBox from "metabase/components/CheckBox";

export const component = CheckBox;

export const description = `
A standard checkbox.
`;

export const examples = {
"off": <CheckBox />,
"on": <CheckBox checked />,
"on inverted": <CheckBox style={{ color: "#509EE3" }} invertChecked checked />
};
14 changes: 14 additions & 0 deletions frontend/src/metabase/components/StackedCheckBox.info.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from "react";
import StackedCheckBox from "metabase/components/StackedCheckBox";

export const component = StackedCheckBox;

export const description = `
A stacked checkbox, representing "all" items.
`;

export const examples = {
"off": <StackedCheckBox />,
"on": <StackedCheckBox checked />,
"on inverted": <StackedCheckBox style={{ color: "#509EE3" }} invertChecked checked />
};
13 changes: 13 additions & 0 deletions frontend/src/metabase/components/Toggle.info.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react";
import Toggle from "metabase/components/Toggle";

export const component = Toggle;

export const description = `
A standard toggle.
`;

export const examples = {
"off": <Toggle value={false} />,
"on": <Toggle value={true} />
};
Loading

0 comments on commit ed89a26

Please sign in to comment.