-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
/
Copy pathinject-parameters.ts.csf.txt
37 lines (28 loc) · 1.09 KB
/
inject-parameters.ts.csf.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React from "react";
import { action } from "@storybook/addon-actions";
import { Button } from "@storybook/react/demo";
export default {
title: "Button",
excludeStories: ["text"],
includeStories: /emoji.*/
};
export const Basic = () => (
<Button onClick={action("clicked")}>Hello Button</Button>
);
export const WithParams = () => <Button>WithParams</Button>;
WithParams.parameters = { foo: 'bar' }
export const WithDocsParams = () => <Button>WithDocsParams</Button>;
WithDocsParams.parameters = { docs: { iframeHeight: 200 } };
export const WithStorySourceParams = () => <Button>WithStorySourceParams</Button>;
WithStorySourceParams.parameters = { storySource: { source: 'foo' } };
const Template = (args: Args) => <Button {...args} />;
export const WithTemplate = Template.bind({});
WithTemplate.args = { foo: 'bar' }
export const WithEmptyTemplate = Template.bind();
WithEmptyTemplate.args = { foo: 'baz' };
export const WithAddFunctionParameters = () => null
WithAddFunctionParameters.parameters = {
foobar: () => {
document.addEventListener('foo', () => console.log('bar'))
},
}