@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
package/dist/cjs/upgrade.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.upgrade = exports.checkVersionConsistency = exports.isCorePackage = exports.getStorybookVersion = void 0;
|
|
6
|
+
exports.upgrade = exports.addExtraFlags = exports.checkVersionConsistency = exports.isCorePackage = exports.getStorybookVersion = void 0;
|
|
7
7
|
|
|
8
8
|
require("core-js/modules/es.promise.js");
|
|
9
9
|
|
|
@@ -91,6 +91,28 @@ const checkVersionConsistency = () => {
|
|
|
91
91
|
};
|
|
92
92
|
|
|
93
93
|
exports.checkVersionConsistency = checkVersionConsistency;
|
|
94
|
+
const EXTRA_FLAGS = {
|
|
95
|
+
'react-scripts@<5': ['--reject', '/preset-create-react-app/']
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const addExtraFlags = (extraFlags, flags, {
|
|
99
|
+
dependencies,
|
|
100
|
+
devDependencies
|
|
101
|
+
}) => {
|
|
102
|
+
return Object.entries(extraFlags).reduce((acc, entry) => {
|
|
103
|
+
const [pattern, extra] = entry;
|
|
104
|
+
const [pkg, specifier] = (0, _jsPackageManager.getPackageDetails)(pattern);
|
|
105
|
+
const pkgVersion = dependencies[pkg] || devDependencies[pkg];
|
|
106
|
+
|
|
107
|
+
if (pkgVersion && _semver.default.satisfies(_semver.default.coerce(pkgVersion), specifier)) {
|
|
108
|
+
return [...acc, ...extra];
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return acc;
|
|
112
|
+
}, [...flags]);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
exports.addExtraFlags = addExtraFlags;
|
|
94
116
|
|
|
95
117
|
const upgrade = async ({
|
|
96
118
|
prerelease,
|
|
@@ -101,10 +123,11 @@ const upgrade = async ({
|
|
|
101
123
|
const packageManager = _jsPackageManager.JsPackageManagerFactory.getPackageManager(useNpm);
|
|
102
124
|
|
|
103
125
|
(0, _helpers.commandLog)(`Checking for latest versions of '@storybook/*' packages`);
|
|
104
|
-
|
|
126
|
+
let flags = [];
|
|
105
127
|
if (!dryRun) flags.push('--upgrade');
|
|
106
128
|
flags.push('--target');
|
|
107
129
|
flags.push(prerelease ? 'greatest' : 'latest');
|
|
130
|
+
flags = addExtraFlags(EXTRA_FLAGS, flags, packageManager.retrievePackageJson());
|
|
108
131
|
const check = (0, _crossSpawn.sync)('npx', ['npm-check-updates', '/storybook/', ...flags], {
|
|
109
132
|
stdio: 'pipe'
|
|
110
133
|
}).output.toString();
|
package/dist/cjs/versions.json
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
{
|
|
2
|
-
"@storybook/addon-a11y": "6.3.
|
|
3
|
-
"@storybook/addon-actions": "6.3.
|
|
4
|
-
"@storybook/addon-backgrounds": "6.3.
|
|
5
|
-
"@storybook/addon-controls": "6.3.
|
|
6
|
-
"@storybook/addon-docs": "6.3.
|
|
7
|
-
"@storybook/addon-essentials": "6.3.
|
|
8
|
-
"@storybook/addon-jest": "6.3.
|
|
9
|
-
"@storybook/addon-links": "6.3.
|
|
10
|
-
"@storybook/addon-storyshots": "6.3.
|
|
11
|
-
"@storybook/addon-storyshots-puppeteer": "6.3.
|
|
12
|
-
"@storybook/addon-storysource": "6.3.
|
|
13
|
-
"@storybook/addon-toolbars": "6.3.
|
|
14
|
-
"@storybook/addon-viewport": "6.3.
|
|
15
|
-
"@storybook/addons": "6.3.
|
|
16
|
-
"@storybook/angular": "6.3.
|
|
17
|
-
"@storybook/api": "6.3.
|
|
18
|
-
"@storybook/aurelia": "6.3.
|
|
19
|
-
"@storybook/builder-webpack4": "6.3.
|
|
20
|
-
"@storybook/builder-webpack5": "6.3.
|
|
21
|
-
"@storybook/channel-postmessage": "6.3.
|
|
22
|
-
"@storybook/channel-websocket": "6.3.
|
|
23
|
-
"@storybook/channels": "6.3.
|
|
24
|
-
"@storybook/cli": "6.3.
|
|
25
|
-
"@storybook/client-api": "6.3.
|
|
26
|
-
"@storybook/client-logger": "6.3.
|
|
27
|
-
"@storybook/codemod": "6.3.
|
|
28
|
-
"@storybook/components": "6.3.
|
|
29
|
-
"@storybook/core": "6.3.
|
|
30
|
-
"@storybook/core-client": "6.3.
|
|
31
|
-
"@storybook/core-common": "6.3.
|
|
32
|
-
"@storybook/core-events": "6.3.
|
|
33
|
-
"@storybook/core-server": "6.3.
|
|
34
|
-
"@storybook/csf-tools": "6.3.
|
|
35
|
-
"@storybook/ember": "6.3.
|
|
36
|
-
"@storybook/html": "6.3.
|
|
37
|
-
"@storybook/manager-webpack4": "6.3.
|
|
38
|
-
"@storybook/manager-webpack5": "6.3.
|
|
39
|
-
"@storybook/marionette": "6.3.
|
|
40
|
-
"@storybook/marko": "6.3.
|
|
41
|
-
"@storybook/mithril": "6.3.
|
|
42
|
-
"@storybook/node-logger": "6.3.
|
|
43
|
-
"@storybook/postinstall": "6.3.
|
|
44
|
-
"@storybook/preact": "6.3.
|
|
45
|
-
"@storybook/rax": "6.3.
|
|
46
|
-
"@storybook/react": "6.3.
|
|
47
|
-
"@storybook/riot": "6.3.
|
|
48
|
-
"@storybook/router": "6.3.
|
|
49
|
-
"@storybook/server": "6.3.
|
|
50
|
-
"@storybook/source-loader": "6.3.
|
|
51
|
-
"@storybook/svelte": "6.3.
|
|
52
|
-
"@storybook/theming": "6.3.
|
|
53
|
-
"@storybook/ui": "6.3.
|
|
54
|
-
"@storybook/vue": "6.3.
|
|
55
|
-
"@storybook/vue3": "6.3.
|
|
56
|
-
"@storybook/web-components": "6.3.
|
|
2
|
+
"@storybook/addon-a11y": "6.3.10",
|
|
3
|
+
"@storybook/addon-actions": "6.3.10",
|
|
4
|
+
"@storybook/addon-backgrounds": "6.3.10",
|
|
5
|
+
"@storybook/addon-controls": "6.3.10",
|
|
6
|
+
"@storybook/addon-docs": "6.3.10",
|
|
7
|
+
"@storybook/addon-essentials": "6.3.10",
|
|
8
|
+
"@storybook/addon-jest": "6.3.10",
|
|
9
|
+
"@storybook/addon-links": "6.3.10",
|
|
10
|
+
"@storybook/addon-storyshots": "6.3.10",
|
|
11
|
+
"@storybook/addon-storyshots-puppeteer": "6.3.10",
|
|
12
|
+
"@storybook/addon-storysource": "6.3.10",
|
|
13
|
+
"@storybook/addon-toolbars": "6.3.10",
|
|
14
|
+
"@storybook/addon-viewport": "6.3.10",
|
|
15
|
+
"@storybook/addons": "6.3.10",
|
|
16
|
+
"@storybook/angular": "6.3.10",
|
|
17
|
+
"@storybook/api": "6.3.10",
|
|
18
|
+
"@storybook/aurelia": "6.3.10",
|
|
19
|
+
"@storybook/builder-webpack4": "6.3.10",
|
|
20
|
+
"@storybook/builder-webpack5": "6.3.10",
|
|
21
|
+
"@storybook/channel-postmessage": "6.3.10",
|
|
22
|
+
"@storybook/channel-websocket": "6.3.10",
|
|
23
|
+
"@storybook/channels": "6.3.10",
|
|
24
|
+
"@storybook/cli": "6.3.10",
|
|
25
|
+
"@storybook/client-api": "6.3.10",
|
|
26
|
+
"@storybook/client-logger": "6.3.10",
|
|
27
|
+
"@storybook/codemod": "6.3.10",
|
|
28
|
+
"@storybook/components": "6.3.10",
|
|
29
|
+
"@storybook/core": "6.3.10",
|
|
30
|
+
"@storybook/core-client": "6.3.10",
|
|
31
|
+
"@storybook/core-common": "6.3.10",
|
|
32
|
+
"@storybook/core-events": "6.3.10",
|
|
33
|
+
"@storybook/core-server": "6.3.10",
|
|
34
|
+
"@storybook/csf-tools": "6.3.10",
|
|
35
|
+
"@storybook/ember": "6.3.10",
|
|
36
|
+
"@storybook/html": "6.3.10",
|
|
37
|
+
"@storybook/manager-webpack4": "6.3.10",
|
|
38
|
+
"@storybook/manager-webpack5": "6.3.10",
|
|
39
|
+
"@storybook/marionette": "6.3.10",
|
|
40
|
+
"@storybook/marko": "6.3.10",
|
|
41
|
+
"@storybook/mithril": "6.3.10",
|
|
42
|
+
"@storybook/node-logger": "6.3.10",
|
|
43
|
+
"@storybook/postinstall": "6.3.10",
|
|
44
|
+
"@storybook/preact": "6.3.10",
|
|
45
|
+
"@storybook/rax": "6.3.10",
|
|
46
|
+
"@storybook/react": "6.3.10",
|
|
47
|
+
"@storybook/riot": "6.3.10",
|
|
48
|
+
"@storybook/router": "6.3.10",
|
|
49
|
+
"@storybook/server": "6.3.10",
|
|
50
|
+
"@storybook/source-loader": "6.3.10",
|
|
51
|
+
"@storybook/svelte": "6.3.10",
|
|
52
|
+
"@storybook/theming": "6.3.10",
|
|
53
|
+
"@storybook/ui": "6.3.10",
|
|
54
|
+
"@storybook/vue": "6.3.10",
|
|
55
|
+
"@storybook/vue3": "6.3.10",
|
|
56
|
+
"@storybook/web-components": "6.3.10"
|
|
57
57
|
}
|
|
@@ -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',
|