@storybook/cli 6.3.6 → 6.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/frameworks/angular/Button.stories.ts +4 -0
- package/dist/cjs/frameworks/angular/Page.stories.ts +1 -0
- package/dist/cjs/frameworks/ember/1-Button.stories.js +4 -0
- package/dist/cjs/frameworks/html/js/Button.stories.js +8 -3
- package/dist/cjs/frameworks/html/js/Page.stories.js +1 -0
- package/dist/cjs/frameworks/html/ts/Button.stories.ts +8 -3
- package/dist/cjs/frameworks/html/ts/Page.stories.ts +1 -0
- package/dist/cjs/frameworks/marko/1-Button.stories.js +6 -2
- package/dist/cjs/frameworks/mithril/Button.stories.js +4 -0
- package/dist/cjs/frameworks/mithril/Page.stories.js +1 -0
- package/dist/cjs/frameworks/preact/Button.stories.jsx +4 -0
- package/dist/cjs/frameworks/preact/Page.stories.jsx +1 -0
- package/dist/cjs/frameworks/rax/Button.stories.js +4 -0
- package/dist/cjs/frameworks/rax/Page.stories.js +1 -0
- package/dist/cjs/frameworks/react/js/Button.stories.jsx +4 -0
- package/dist/cjs/frameworks/react/js/Page.stories.jsx +1 -0
- package/dist/cjs/frameworks/react/ts/Button.stories.tsx +4 -0
- package/dist/cjs/frameworks/react/ts/Page.stories.tsx +1 -0
- package/dist/cjs/frameworks/riot/1-Button.stories.js +4 -0
- package/dist/cjs/frameworks/svelte/Button.stories.svelte +8 -3
- package/dist/cjs/frameworks/vue/Button.stories.js +8 -1
- package/dist/cjs/frameworks/vue/Page.stories.js +1 -0
- package/dist/cjs/frameworks/vue3/Button.stories.js +8 -1
- package/dist/cjs/frameworks/vue3/Page.stories.js +1 -0
- package/dist/cjs/frameworks/web-components/js/Button.stories.js +8 -0
- package/dist/cjs/frameworks/web-components/js/Page.stories.js +1 -0
- package/dist/cjs/frameworks/web-components/ts/Button.stories.ts +8 -0
- package/dist/cjs/frameworks/web-components/ts/Page.stories.ts +1 -0
- package/dist/cjs/generators/REACT_SCRIPTS/index.js +21 -4
- package/dist/cjs/generators/baseGenerator.js +3 -1
- package/dist/cjs/upgrade.js +25 -2
- package/dist/cjs/versions.json +55 -55
- package/dist/esm/frameworks/angular/Button.stories.ts +4 -0
- package/dist/esm/frameworks/angular/Page.stories.ts +1 -0
- package/dist/esm/frameworks/ember/1-Button.stories.js +4 -0
- package/dist/esm/frameworks/html/js/Button.stories.js +8 -3
- package/dist/esm/frameworks/html/js/Page.stories.js +1 -0
- package/dist/esm/frameworks/html/ts/Button.stories.ts +8 -3
- package/dist/esm/frameworks/html/ts/Page.stories.ts +1 -0
- package/dist/esm/frameworks/marko/1-Button.stories.js +6 -2
- package/dist/esm/frameworks/mithril/Button.stories.js +4 -0
- package/dist/esm/frameworks/mithril/Page.stories.js +1 -0
- package/dist/esm/frameworks/preact/Button.stories.jsx +4 -0
- package/dist/esm/frameworks/preact/Page.stories.jsx +1 -0
- package/dist/esm/frameworks/rax/Button.stories.js +4 -0
- package/dist/esm/frameworks/rax/Page.stories.js +1 -0
- package/dist/esm/frameworks/react/js/Button.stories.jsx +4 -0
- package/dist/esm/frameworks/react/js/Page.stories.jsx +1 -0
- package/dist/esm/frameworks/react/ts/Button.stories.tsx +4 -0
- package/dist/esm/frameworks/react/ts/Page.stories.tsx +1 -0
- package/dist/esm/frameworks/riot/1-Button.stories.js +4 -0
- package/dist/esm/frameworks/svelte/Button.stories.svelte +8 -3
- package/dist/esm/frameworks/vue/Button.stories.js +8 -1
- package/dist/esm/frameworks/vue/Page.stories.js +1 -0
- package/dist/esm/frameworks/vue3/Button.stories.js +8 -1
- package/dist/esm/frameworks/vue3/Page.stories.js +1 -0
- package/dist/esm/frameworks/web-components/js/Button.stories.js +8 -0
- package/dist/esm/frameworks/web-components/js/Page.stories.js +1 -0
- package/dist/esm/frameworks/web-components/ts/Button.stories.ts +8 -0
- package/dist/esm/frameworks/web-components/ts/Page.stories.ts +1 -0
- package/dist/esm/generators/REACT_SCRIPTS/index.js +21 -4
- package/dist/esm/generators/baseGenerator.js +3 -1
- package/dist/esm/upgrade.js +25 -2
- package/dist/esm/versions.json +55 -55
- package/dist/modern/frameworks/ember/1-Button.stories.js +4 -0
- package/dist/modern/frameworks/html/js/Button.stories.js +8 -3
- package/dist/modern/frameworks/html/js/Page.stories.js +1 -0
- package/dist/modern/frameworks/marko/1-Button.stories.js +6 -2
- package/dist/modern/frameworks/mithril/Button.stories.js +4 -0
- package/dist/modern/frameworks/mithril/Page.stories.js +1 -0
- package/dist/modern/frameworks/preact/Button.stories.jsx +4 -0
- package/dist/modern/frameworks/preact/Page.stories.jsx +1 -0
- package/dist/modern/frameworks/rax/Button.stories.js +4 -0
- package/dist/modern/frameworks/rax/Page.stories.js +1 -0
- package/dist/modern/frameworks/react/js/Button.stories.jsx +4 -0
- package/dist/modern/frameworks/react/js/Page.stories.jsx +1 -0
- package/dist/modern/frameworks/riot/1-Button.stories.js +4 -0
- package/dist/modern/frameworks/svelte/Button.stories.svelte +8 -3
- package/dist/modern/frameworks/vue/Button.stories.js +8 -1
- package/dist/modern/frameworks/vue/Page.stories.js +1 -0
- package/dist/modern/frameworks/vue3/Button.stories.js +8 -1
- package/dist/modern/frameworks/vue3/Page.stories.js +1 -0
- package/dist/modern/frameworks/web-components/js/Button.stories.js +8 -0
- package/dist/modern/frameworks/web-components/js/Page.stories.js +1 -0
- package/dist/modern/generators/REACT_SCRIPTS/index.js +21 -4
- package/dist/modern/generators/baseGenerator.js +3 -1
- package/dist/modern/upgrade.js +25 -2
- package/dist/modern/versions.json +55 -55
- package/dist/ts3.4/upgrade.d.ts +3 -0
- package/dist/ts3.9/upgrade.d.ts +3 -0
- package/package.json +5 -5
|
@@ -2,19 +2,23 @@
|
|
|
2
2
|
import { Story, Meta } from '@storybook/angular/types-6-0';
|
|
3
3
|
import Button from './button.component';
|
|
4
4
|
|
|
5
|
+
// More on default export: https://storybook.js.org/docs/angular/writing-stories/introduction#default-export
|
|
5
6
|
export default {
|
|
6
7
|
title: 'Example/Button',
|
|
7
8
|
component: Button,
|
|
9
|
+
// More on argTypes: https://storybook.js.org/docs/angular/api/argtypes
|
|
8
10
|
argTypes: {
|
|
9
11
|
backgroundColor: { control: 'color' },
|
|
10
12
|
},
|
|
11
13
|
} as Meta;
|
|
12
14
|
|
|
15
|
+
// More on component templates: https://storybook.js.org/docs/angular/writing-stories/introduction#using-args
|
|
13
16
|
const Template: Story<Button> = (args: Button) => ({
|
|
14
17
|
props: args,
|
|
15
18
|
});
|
|
16
19
|
|
|
17
20
|
export const Primary = Template.bind({});
|
|
21
|
+
// More on args: https://storybook.js.org/docs/angular/writing-stories/args
|
|
18
22
|
Primary.args = {
|
|
19
23
|
primary: true,
|
|
20
24
|
label: 'Button',
|
|
@@ -24,6 +24,7 @@ const Template: Story<Page> = (args: Page) => ({
|
|
|
24
24
|
|
|
25
25
|
export const LoggedIn = Template.bind({});
|
|
26
26
|
LoggedIn.args = {
|
|
27
|
+
// More on composing args: https://storybook.js.org/docs/angular/writing-stories/args#args-composition
|
|
27
28
|
...HeaderStories.LoggedIn.args,
|
|
28
29
|
};
|
|
29
30
|
|
|
@@ -2,19 +2,23 @@ import { hbs } from 'ember-cli-htmlbars';
|
|
|
2
2
|
import { action } from '@storybook/addon-actions';
|
|
3
3
|
import { linkTo } from '@storybook/addon-links';
|
|
4
4
|
|
|
5
|
+
// More on default export: https://storybook.js.org/docs/ember/writing-stories/introduction#default-export
|
|
5
6
|
export default {
|
|
6
7
|
title: 'Button',
|
|
8
|
+
// More on argTypes: https://storybook.js.org/docs/ember/api/argtypes
|
|
7
9
|
argTypes: {
|
|
8
10
|
children: { control: 'text' },
|
|
9
11
|
},
|
|
10
12
|
};
|
|
11
13
|
|
|
14
|
+
// More on component templates: https://storybook.js.org/docs/ember/writing-stories/introduction#using-args
|
|
12
15
|
const Template = (args) => ({
|
|
13
16
|
template: hbs`<button {{action onClick}}>{{children}}</button>`,
|
|
14
17
|
context: args,
|
|
15
18
|
});
|
|
16
19
|
|
|
17
20
|
export const Text = Template.bind({});
|
|
21
|
+
// More on args: https://storybook.js.org/docs/ember/writing-stories/args
|
|
18
22
|
Text.args = {
|
|
19
23
|
children: 'Button',
|
|
20
24
|
onClick: action('onClick'),
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import { createButton } from './Button';
|
|
2
2
|
|
|
3
|
+
// More on default export: https://storybook.js.org/docs/html/writing-stories/introduction#default-export
|
|
3
4
|
export default {
|
|
4
5
|
title: 'Example/Button',
|
|
6
|
+
// More on argTypes: https://storybook.js.org/docs/html/api/argtypes
|
|
5
7
|
argTypes: {
|
|
8
|
+
backgroundColor: { control: 'color' },
|
|
6
9
|
label: { control: 'text' },
|
|
10
|
+
onClick: { action: 'onClick' },
|
|
7
11
|
primary: { control: 'boolean' },
|
|
8
|
-
backgroundColor: { control: 'color' },
|
|
9
12
|
size: {
|
|
10
|
-
control: { type: 'select'
|
|
13
|
+
control: { type: 'select' },
|
|
14
|
+
options: ['small', 'medium', 'large'],
|
|
11
15
|
},
|
|
12
|
-
onClick: { action: 'onClick' },
|
|
13
16
|
},
|
|
14
17
|
};
|
|
15
18
|
|
|
19
|
+
// More on component templates: https://storybook.js.org/docs/html/writing-stories/introduction#using-args
|
|
16
20
|
const Template = ({ label, ...args }) => {
|
|
17
21
|
// You can either use a function to create DOM elements or use a plain html string!
|
|
18
22
|
// return `<div>${label}</div>`;
|
|
@@ -20,6 +24,7 @@ const Template = ({ label, ...args }) => {
|
|
|
20
24
|
};
|
|
21
25
|
|
|
22
26
|
export const Primary = Template.bind({});
|
|
27
|
+
// More on args: https://storybook.js.org/docs/html/writing-stories/args
|
|
23
28
|
Primary.args = {
|
|
24
29
|
primary: true,
|
|
25
30
|
label: 'Button',
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
import { Story, Meta } from '@storybook/html';
|
|
2
2
|
import { createButton, ButtonProps } from './Button';
|
|
3
3
|
|
|
4
|
+
// More on default export: https://storybook.js.org/docs/html/writing-stories/introduction#default-export
|
|
4
5
|
export default {
|
|
5
6
|
title: 'Example/Button',
|
|
7
|
+
// More on argTypes: https://storybook.js.org/docs/html/api/argtypes
|
|
6
8
|
argTypes: {
|
|
9
|
+
backgroundColor: { control: 'color' },
|
|
7
10
|
label: { control: 'text' },
|
|
11
|
+
onClick: { action: 'onClick' },
|
|
8
12
|
primary: { control: 'boolean' },
|
|
9
|
-
backgroundColor: { control: 'color' },
|
|
10
13
|
size: {
|
|
11
|
-
control: { type: 'select'
|
|
14
|
+
control: { type: 'select' },
|
|
15
|
+
options: ['small', 'medium', 'large'],
|
|
12
16
|
},
|
|
13
|
-
onClick: { action: 'onClick' },
|
|
14
17
|
},
|
|
15
18
|
} as Meta;
|
|
16
19
|
|
|
20
|
+
// More on component templates: https://storybook.js.org/docs/html/writing-stories/introduction#using-args
|
|
17
21
|
const Template: Story<ButtonProps> = (args) => {
|
|
18
22
|
// You can either use a function to create DOM elements or use a plain html string!
|
|
19
23
|
// return `<div>${label}</div>`;
|
|
@@ -21,6 +25,7 @@ const Template: Story<ButtonProps> = (args) => {
|
|
|
21
25
|
};
|
|
22
26
|
|
|
23
27
|
export const Primary = Template.bind({});
|
|
28
|
+
// More on args: https://storybook.js.org/docs/html/writing-stories/args
|
|
24
29
|
Primary.args = {
|
|
25
30
|
primary: true,
|
|
26
31
|
label: 'Button',
|
|
@@ -16,6 +16,7 @@ const Template: Story<HeaderProps> = (args) => createPage(args);
|
|
|
16
16
|
|
|
17
17
|
export const LoggedIn = Template.bind({});
|
|
18
18
|
LoggedIn.args = {
|
|
19
|
+
// More on composing args: https://storybook.js.org/docs/html/writing-stories/args#args-composition
|
|
19
20
|
...HeaderStories.LoggedIn.args,
|
|
20
21
|
};
|
|
21
22
|
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
import { action } from '@storybook/addon-actions';
|
|
2
2
|
import Button from './Button.marko';
|
|
3
3
|
|
|
4
|
+
// More on default export: https://storybook.js.org/docs/marko/writing-stories/introduction#default-export
|
|
4
5
|
export default {
|
|
5
6
|
title: 'Button',
|
|
7
|
+
// More on argTypes: https://storybook.js.org/docs/marko/api/argtypes
|
|
6
8
|
argTypes: {
|
|
7
9
|
children: { control: 'text' },
|
|
8
10
|
},
|
|
9
11
|
};
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
// More on component templates: https://storybook.js.org/docs/marko/writing-stories/introduction#using-args
|
|
14
|
+
const Template = (args) => ({
|
|
12
15
|
component: Button,
|
|
13
16
|
input: args,
|
|
14
17
|
});
|
|
15
18
|
|
|
16
|
-
export const Text =
|
|
19
|
+
export const Text = Template.bind({});
|
|
20
|
+
// More on args: https://storybook.js.org/docs/marko/writing-stories/args
|
|
17
21
|
Text.args = {
|
|
18
22
|
children: 'Button',
|
|
19
23
|
onClick: action('onClick'),
|
|
@@ -2,20 +2,24 @@ import m from 'mithril';
|
|
|
2
2
|
|
|
3
3
|
import { Button } from './Button';
|
|
4
4
|
|
|
5
|
+
// More on default export: https://storybook.js.org/docs/mithril/writing-stories/introduction#default-export
|
|
5
6
|
export default {
|
|
6
7
|
title: 'Example/Button',
|
|
7
8
|
component: Button,
|
|
9
|
+
// More on argTypes: https://storybook.js.org/docs/mithril/api/argtypes
|
|
8
10
|
argTypes: {
|
|
9
11
|
backgroundColor: { control: 'color' },
|
|
10
12
|
onClick: { action: 'onClick' },
|
|
11
13
|
},
|
|
12
14
|
};
|
|
13
15
|
|
|
16
|
+
// More on component templates: https://storybook.js.org/docs/mithril/writing-stories/introduction#using-args
|
|
14
17
|
const Template = ({ children, ...args }) => ({
|
|
15
18
|
view: () => m(Button, args, children),
|
|
16
19
|
});
|
|
17
20
|
|
|
18
21
|
export const Primary = Template.bind({});
|
|
22
|
+
// More on args: https://storybook.js.org/docs/mithril/writing-stories/args
|
|
19
23
|
Primary.args = {
|
|
20
24
|
primary: true,
|
|
21
25
|
children: 'Button',
|
|
@@ -14,6 +14,7 @@ const Template = ({ children, ...args }) => ({
|
|
|
14
14
|
|
|
15
15
|
export const LoggedIn = Template.bind({});
|
|
16
16
|
LoggedIn.args = {
|
|
17
|
+
// More on composing args: https://storybook.js.org/docs/mithril/writing-stories/args#args-composition
|
|
17
18
|
...HeaderStories.LoggedIn.args,
|
|
18
19
|
};
|
|
19
20
|
|
|
@@ -2,18 +2,22 @@
|
|
|
2
2
|
import { h } from 'preact';
|
|
3
3
|
import { Button } from './Button';
|
|
4
4
|
|
|
5
|
+
// More on default export: https://storybook.js.org/docs/preact/writing-stories/introduction#default-export
|
|
5
6
|
export default {
|
|
6
7
|
title: 'Example/Button',
|
|
7
8
|
component: Button,
|
|
9
|
+
// More on argTypes: https://storybook.js.org/docs/preact/api/argtypes
|
|
8
10
|
argTypes: {
|
|
9
11
|
backgroundColor: { control: 'color' },
|
|
10
12
|
onClick: { action: 'onClick' },
|
|
11
13
|
},
|
|
12
14
|
};
|
|
13
15
|
|
|
16
|
+
// More on component templates: https://storybook.js.org/docs/preact/writing-stories/introduction#using-args
|
|
14
17
|
const Template = (args) => <Button {...args} />;
|
|
15
18
|
|
|
16
19
|
export const Primary = Template.bind({});
|
|
20
|
+
// More on args: https://storybook.js.org/docs/preact/writing-stories/args
|
|
17
21
|
Primary.args = {
|
|
18
22
|
primary: true,
|
|
19
23
|
label: 'Button',
|
|
@@ -13,6 +13,7 @@ const Template = (args) => <Page {...args} />;
|
|
|
13
13
|
|
|
14
14
|
export const LoggedIn = Template.bind({});
|
|
15
15
|
LoggedIn.args = {
|
|
16
|
+
// More on composing args: https://storybook.js.org/docs/preact/writing-stories/args#args-composition
|
|
16
17
|
...HeaderStories.LoggedIn.args,
|
|
17
18
|
};
|
|
18
19
|
|
|
@@ -2,17 +2,21 @@ import { createElement } from 'rax';
|
|
|
2
2
|
|
|
3
3
|
import { Button } from './Button';
|
|
4
4
|
|
|
5
|
+
// More on default export: https://storybook.js.org/docs/rax/writing-stories/introduction#default-export
|
|
5
6
|
export default {
|
|
6
7
|
title: 'Example/Button',
|
|
8
|
+
// More on argTypes: https://storybook.js.org/docs/rax/api/argtypes
|
|
7
9
|
argTypes: {
|
|
8
10
|
backgroundColor: { control: 'color' },
|
|
9
11
|
onClick: { action: 'onClick' },
|
|
10
12
|
},
|
|
11
13
|
};
|
|
12
14
|
|
|
15
|
+
// More on component templates: https://storybook.js.org/docs/rax/writing-stories/introduction#using-args
|
|
13
16
|
const Template = (args) => <Button {...args} />;
|
|
14
17
|
|
|
15
18
|
export const Primary = Template.bind({});
|
|
19
|
+
// More on args: https://storybook.js.org/docs/rax/writing-stories/args
|
|
16
20
|
Primary.args = {
|
|
17
21
|
primary: true,
|
|
18
22
|
label: 'Button',
|
|
@@ -11,6 +11,7 @@ const Template = (args) => <Page {...args} />;
|
|
|
11
11
|
|
|
12
12
|
export const LoggedIn = Template.bind({});
|
|
13
13
|
LoggedIn.args = {
|
|
14
|
+
// More on composing args: https://storybook.js.org/docs/rax/writing-stories/args#args-composition
|
|
14
15
|
...HeaderStories.LoggedIn.args,
|
|
15
16
|
};
|
|
16
17
|
|
|
@@ -2,17 +2,21 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { Button } from './Button';
|
|
4
4
|
|
|
5
|
+
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
5
6
|
export default {
|
|
6
7
|
title: 'Example/Button',
|
|
7
8
|
component: Button,
|
|
9
|
+
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
|
8
10
|
argTypes: {
|
|
9
11
|
backgroundColor: { control: 'color' },
|
|
10
12
|
},
|
|
11
13
|
};
|
|
12
14
|
|
|
15
|
+
// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
|
|
13
16
|
const Template = (args) => <Button {...args} />;
|
|
14
17
|
|
|
15
18
|
export const Primary = Template.bind({});
|
|
19
|
+
// More on args: https://storybook.js.org/docs/react/writing-stories/args
|
|
16
20
|
Primary.args = {
|
|
17
21
|
primary: true,
|
|
18
22
|
label: 'Button',
|
|
@@ -12,6 +12,7 @@ const Template = (args) => <Page {...args} />;
|
|
|
12
12
|
|
|
13
13
|
export const LoggedIn = Template.bind({});
|
|
14
14
|
LoggedIn.args = {
|
|
15
|
+
// More on composing args: https://storybook.js.org/docs/react/writing-stories/args#args-composition
|
|
15
16
|
...HeaderStories.LoggedIn.args,
|
|
16
17
|
};
|
|
17
18
|
|
|
@@ -3,17 +3,21 @@ import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
|
3
3
|
|
|
4
4
|
import { Button } from './Button';
|
|
5
5
|
|
|
6
|
+
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
6
7
|
export default {
|
|
7
8
|
title: 'Example/Button',
|
|
8
9
|
component: Button,
|
|
10
|
+
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
|
9
11
|
argTypes: {
|
|
10
12
|
backgroundColor: { control: 'color' },
|
|
11
13
|
},
|
|
12
14
|
} as ComponentMeta<typeof Button>;
|
|
13
15
|
|
|
16
|
+
// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
|
|
14
17
|
const Template: ComponentStory<typeof Button> = (args) => <Button {...args} />;
|
|
15
18
|
|
|
16
19
|
export const Primary = Template.bind({});
|
|
20
|
+
// More on args: https://storybook.js.org/docs/react/writing-stories/args
|
|
17
21
|
Primary.args = {
|
|
18
22
|
primary: true,
|
|
19
23
|
label: 'Button',
|
|
@@ -13,6 +13,7 @@ const Template: ComponentStory<typeof Page> = (args) => <Page {...args} />;
|
|
|
13
13
|
|
|
14
14
|
export const LoggedIn = Template.bind({});
|
|
15
15
|
LoggedIn.args = {
|
|
16
|
+
// More on composing args: https://storybook.js.org/docs/react/writing-stories/args#args-composition
|
|
16
17
|
...HeaderStories.LoggedIn.args,
|
|
17
18
|
};
|
|
18
19
|
|
|
@@ -6,16 +6,20 @@ import { action } from '@storybook/addon-actions';
|
|
|
6
6
|
import MyButtonRaw from 'raw-loader!./MyButton.tag';
|
|
7
7
|
import './MyButton.tag';
|
|
8
8
|
|
|
9
|
+
// More on default export: https://storybook.js.org/docs/riot/writing-stories/introduction#default-export
|
|
9
10
|
export default {
|
|
10
11
|
title: 'Button',
|
|
12
|
+
// More on argTypes: https://storybook.js.org/docs/riot/api/argtypes
|
|
11
13
|
argTypes: {
|
|
12
14
|
content: { control: 'text' },
|
|
13
15
|
},
|
|
14
16
|
};
|
|
15
17
|
|
|
18
|
+
// More on component templates: https://storybook.js.org/docs/riot/writing-stories/introduction#using-args
|
|
16
19
|
const Template = (args) => mount('my-button', args);
|
|
17
20
|
|
|
18
21
|
export const Text = Template.bind({});
|
|
22
|
+
// More on args: https://storybook.js.org/docs/riot/writing-stories/args
|
|
19
23
|
Text.args = {
|
|
20
24
|
content: 'Button',
|
|
21
25
|
onClick: action('onClick'),
|
|
@@ -3,24 +3,29 @@
|
|
|
3
3
|
import Button from "./Button.svelte";
|
|
4
4
|
</script>
|
|
5
5
|
|
|
6
|
+
<!-- More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export -->
|
|
7
|
+
<!-- More on argTypes: https://storybook.js.org/docs/svelte/api/argtypes -->
|
|
6
8
|
<Meta
|
|
7
9
|
title="Example/Button"
|
|
8
10
|
component={Button}
|
|
9
11
|
argTypes={{
|
|
12
|
+
backgroundColor: { control: "color" },
|
|
10
13
|
label: { control: "text" },
|
|
14
|
+
onClick: { action: "onClick" },
|
|
11
15
|
primary: { control: "boolean" },
|
|
12
|
-
backgroundColor: { control: "color" },
|
|
13
16
|
size: {
|
|
14
|
-
control: { type:
|
|
17
|
+
control: { type: 'select' },
|
|
18
|
+
options: ['small', 'medium', 'large'],
|
|
15
19
|
},
|
|
16
|
-
onClick: { action: "onClick" },
|
|
17
20
|
}}
|
|
18
21
|
/>
|
|
19
22
|
|
|
23
|
+
<!-- More on component templates: https://storybook.js.org/docs/svelte/writing-stories/introduction#using-args -->
|
|
20
24
|
<Template let:args>
|
|
21
25
|
<Button {...args} on:click={args.onClick} />
|
|
22
26
|
</Template>
|
|
23
27
|
|
|
28
|
+
<!-- More on args: https://storybook.js.org/docs/svelte/writing-stories/args -->
|
|
24
29
|
<Story
|
|
25
30
|
name="Primary"
|
|
26
31
|
args={{
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import MyButton from './Button.vue';
|
|
2
2
|
|
|
3
|
+
// More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
|
|
3
4
|
export default {
|
|
4
5
|
title: 'Example/Button',
|
|
5
6
|
component: MyButton,
|
|
7
|
+
// More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
|
|
6
8
|
argTypes: {
|
|
7
9
|
backgroundColor: { control: 'color' },
|
|
8
|
-
size: {
|
|
10
|
+
size: {
|
|
11
|
+
control: { type: 'select' },
|
|
12
|
+
options: ['small', 'medium', 'large'],
|
|
13
|
+
},
|
|
9
14
|
},
|
|
10
15
|
};
|
|
11
16
|
|
|
17
|
+
// More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
|
|
12
18
|
const Template = (args, { argTypes }) => ({
|
|
13
19
|
props: Object.keys(argTypes),
|
|
14
20
|
components: { MyButton },
|
|
@@ -16,6 +22,7 @@ const Template = (args, { argTypes }) => ({
|
|
|
16
22
|
});
|
|
17
23
|
|
|
18
24
|
export const Primary = Template.bind({});
|
|
25
|
+
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
|
19
26
|
Primary.args = {
|
|
20
27
|
primary: true,
|
|
21
28
|
label: 'Button',
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import MyButton from './Button.vue';
|
|
2
2
|
|
|
3
|
+
// More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
|
|
3
4
|
export default {
|
|
4
5
|
title: 'Example/Button',
|
|
5
6
|
component: MyButton,
|
|
7
|
+
// More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
|
|
6
8
|
argTypes: {
|
|
7
9
|
backgroundColor: { control: 'color' },
|
|
8
|
-
size: { control: { type: 'select', options: ['small', 'medium', 'large'] } },
|
|
9
10
|
onClick: {},
|
|
11
|
+
size: {
|
|
12
|
+
control: { type: 'select' },
|
|
13
|
+
options: ['small', 'medium', 'large'],
|
|
14
|
+
},
|
|
10
15
|
},
|
|
11
16
|
};
|
|
12
17
|
|
|
18
|
+
// More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
|
|
13
19
|
const Template = (args) => ({
|
|
14
20
|
// Components used in your story `template` are defined in the `components` object
|
|
15
21
|
components: { MyButton },
|
|
@@ -22,6 +28,7 @@ const Template = (args) => ({
|
|
|
22
28
|
});
|
|
23
29
|
|
|
24
30
|
export const Primary = Template.bind({});
|
|
31
|
+
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
|
25
32
|
Primary.args = {
|
|
26
33
|
primary: true,
|
|
27
34
|
label: 'Button',
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
import { Button } from './Button';
|
|
2
2
|
|
|
3
|
+
// More on default export: https://storybook.js.org/docs/web-components/writing-stories/introduction#default-export
|
|
3
4
|
export default {
|
|
4
5
|
title: 'Example/Button',
|
|
6
|
+
// More on argTypes: https://storybook.js.org/docs/web-components/api/argtypes
|
|
5
7
|
argTypes: {
|
|
6
8
|
backgroundColor: { control: 'color' },
|
|
7
9
|
onClick: { action: 'onClick' },
|
|
10
|
+
size: {
|
|
11
|
+
control: { type: 'select' },
|
|
12
|
+
options: ['small', 'medium', 'large'],
|
|
13
|
+
},
|
|
8
14
|
},
|
|
9
15
|
};
|
|
10
16
|
|
|
17
|
+
// More on component templates: https://storybook.js.org/docs/web-components/writing-stories/introduction#using-args
|
|
11
18
|
const Template = (args) => Button(args);
|
|
12
19
|
|
|
13
20
|
export const Primary = Template.bind({});
|
|
21
|
+
// More on args: https://storybook.js.org/docs/web-components/writing-stories/args
|
|
14
22
|
Primary.args = {
|
|
15
23
|
primary: true,
|
|
16
24
|
label: 'Button',
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import { Story, Meta } from '@storybook/web-components';
|
|
2
2
|
import { Button, ButtonProps } from './Button';
|
|
3
3
|
|
|
4
|
+
// More on default export: https://storybook.js.org/docs/web-components/writing-stories/introduction#default-export
|
|
4
5
|
export default {
|
|
5
6
|
title: 'Example/Button',
|
|
7
|
+
// More on argTypes: https://storybook.js.org/docs/web-components/api/argtypes
|
|
6
8
|
argTypes: {
|
|
7
9
|
backgroundColor: { control: 'color' },
|
|
8
10
|
onClick: { action: 'onClick' },
|
|
11
|
+
size: {
|
|
12
|
+
control: { type: 'select' },
|
|
13
|
+
options: ['small', 'medium', 'large'],
|
|
14
|
+
},
|
|
9
15
|
},
|
|
10
16
|
} as Meta;
|
|
11
17
|
|
|
18
|
+
// More on component templates: https://storybook.js.org/docs/web-components/writing-stories/introduction#using-args
|
|
12
19
|
const Template: Story<Partial<ButtonProps>> = (args) => Button(args);
|
|
13
20
|
|
|
14
21
|
export const Primary = Template.bind({});
|
|
22
|
+
// More on args: https://storybook.js.org/docs/web-components/writing-stories/args
|
|
15
23
|
Primary.args = {
|
|
16
24
|
primary: true,
|
|
17
25
|
label: 'Button',
|
|
@@ -10,6 +10,7 @@ const Template: Story<Partial<PageProps>> = (args) => Page(args);
|
|
|
10
10
|
|
|
11
11
|
export const LoggedIn = Template.bind({});
|
|
12
12
|
LoggedIn.args = {
|
|
13
|
+
// More on composing args: https://storybook.js.org/docs/web-components/writing-stories/args#args-composition
|
|
13
14
|
...HeaderStories.LoggedIn.args,
|
|
14
15
|
};
|
|
15
16
|
|
|
@@ -11,11 +11,17 @@ var _path = _interopRequireDefault(require("path"));
|
|
|
11
11
|
|
|
12
12
|
var _fs = _interopRequireDefault(require("fs"));
|
|
13
13
|
|
|
14
|
+
var _semver = _interopRequireDefault(require("@storybook/semver"));
|
|
15
|
+
|
|
14
16
|
var _baseGenerator = require("../baseGenerator");
|
|
15
17
|
|
|
18
|
+
var _project_types = require("../../project_types");
|
|
19
|
+
|
|
16
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
21
|
|
|
18
22
|
const generator = async (packageManager, npmOptions, options) => {
|
|
23
|
+
var _semver$coerce;
|
|
24
|
+
|
|
19
25
|
const extraMain = options.linkable ? {
|
|
20
26
|
webpackFinal: `%%(config) => {
|
|
21
27
|
const path = require('path');
|
|
@@ -29,10 +35,21 @@ const generator = async (packageManager, npmOptions, options) => {
|
|
|
29
35
|
}
|
|
30
36
|
%%`
|
|
31
37
|
} : {};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
const craVersion = (_semver$coerce = _semver.default.coerce(packageManager.retrievePackageJson().dependencies['react-scripts'])) === null || _semver$coerce === void 0 ? void 0 : _semver$coerce.version;
|
|
39
|
+
|
|
40
|
+
const isCra5 = _semver.default.gte(craVersion, '5.0.0');
|
|
41
|
+
|
|
42
|
+
const updatedOptions = isCra5 ? Object.assign({}, options, {
|
|
43
|
+
builder: _project_types.CoreBuilder.Webpack5
|
|
44
|
+
}) : options; // `@storybook/preset-create-react-app` has `@storybook/node-logger` as peerDep
|
|
45
|
+
|
|
46
|
+
const extraPackages = ['@storybook/node-logger'];
|
|
47
|
+
if (isCra5) extraPackages.push('webpack'); // preset v3 is compat with older versions of CRA, otherwise let version float
|
|
48
|
+
|
|
49
|
+
const extraAddons = [`@storybook/preset-create-react-app${isCra5 ? '' : '@3'}`];
|
|
50
|
+
await (0, _baseGenerator.baseGenerator)(packageManager, npmOptions, updatedOptions, 'react', {
|
|
51
|
+
extraAddons,
|
|
52
|
+
extraPackages,
|
|
36
53
|
staticDir: _fs.default.existsSync(_path.default.resolve('./public')) ? 'public' : undefined,
|
|
37
54
|
addBabel: false,
|
|
38
55
|
addESLint: true,
|
|
@@ -41,6 +41,8 @@ const builderDependencies = builder => {
|
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
+
const stripVersions = addons => addons.map(addon => (0, _jsPackageManager.getPackageDetails)(addon)[0]);
|
|
45
|
+
|
|
44
46
|
async function baseGenerator(packageManager, npmOptions, {
|
|
45
47
|
language,
|
|
46
48
|
builder
|
|
@@ -72,7 +74,7 @@ async function baseGenerator(packageManager, npmOptions, {
|
|
|
72
74
|
}
|
|
73
75
|
}, extraMain) : extraMain;
|
|
74
76
|
(0, _configure.configure)(framework, Object.assign({
|
|
75
|
-
addons: [...addons, ...extraAddons],
|
|
77
|
+
addons: [...addons, ...stripVersions(extraAddons)],
|
|
76
78
|
extensions,
|
|
77
79
|
commonJs: options.commonJs
|
|
78
80
|
}, mainOptions));
|