@storybook/cli 6.5.0-alpha.23 → 6.5.0-alpha.24
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/svelte/Button.stories.js +51 -0
- package/dist/cjs/frameworks/svelte/Header.stories.js +29 -0
- package/dist/cjs/frameworks/svelte/Page.stories.js +29 -0
- package/dist/cjs/generators/ANGULAR/template-csf/.storybook/tsconfig.json +16 -5
- package/dist/cjs/generators/AURELIA/template-csf/.storybook/tsconfig.json +16 -5
- package/dist/cjs/generators/SVELTE/index.js +0 -1
- package/dist/cjs/versions.json +55 -57
- package/dist/esm/frameworks/svelte/Button.stories.js +51 -0
- package/dist/esm/frameworks/svelte/Header.stories.js +29 -0
- package/dist/esm/frameworks/svelte/Page.stories.js +29 -0
- package/dist/esm/generators/ANGULAR/template-csf/.storybook/tsconfig.json +16 -5
- package/dist/esm/generators/AURELIA/template-csf/.storybook/tsconfig.json +16 -5
- package/dist/esm/generators/SVELTE/index.js +0 -1
- package/dist/esm/versions.json +55 -57
- package/dist/modern/frameworks/svelte/Button.stories.js +51 -0
- package/dist/modern/frameworks/svelte/Header.stories.js +29 -0
- package/dist/modern/frameworks/svelte/Page.stories.js +29 -0
- package/dist/modern/generators/ANGULAR/template-csf/.storybook/tsconfig.json +16 -5
- package/dist/modern/generators/AURELIA/template-csf/.storybook/tsconfig.json +16 -5
- package/dist/modern/generators/SVELTE/index.js +0 -1
- package/dist/modern/versions.json +55 -57
- package/package.json +7 -7
- package/dist/cjs/frameworks/svelte/Button.stories.svelte +0 -57
- package/dist/cjs/frameworks/svelte/Header.stories.svelte +0 -32
- package/dist/cjs/frameworks/svelte/Page.stories.svelte +0 -32
- package/dist/esm/frameworks/svelte/Button.stories.svelte +0 -57
- package/dist/esm/frameworks/svelte/Header.stories.svelte +0 -32
- package/dist/esm/frameworks/svelte/Page.stories.svelte +0 -32
- package/dist/modern/frameworks/svelte/Button.stories.svelte +0 -57
- package/dist/modern/frameworks/svelte/Header.stories.svelte +0 -32
- package/dist/modern/frameworks/svelte/Page.stories.svelte +0 -32
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import Header from './Header.svelte';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Example/Header',
|
|
5
|
+
component: Header,
|
|
6
|
+
argTypes: {
|
|
7
|
+
onLogin: { action: 'onLogin' },
|
|
8
|
+
onLogout: { action: 'onLogout' },
|
|
9
|
+
onCreateAccount: { action: 'onCreateAccount' },
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const Template = (args) => ({
|
|
14
|
+
Component: Header,
|
|
15
|
+
props: args,
|
|
16
|
+
on: {
|
|
17
|
+
login: args.onLogin,
|
|
18
|
+
logout: args.onLogout,
|
|
19
|
+
createAccount: args.onCreateAccount,
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export const LoggedIn = Template.bind({});
|
|
24
|
+
LoggedIn.args = {
|
|
25
|
+
user: {},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const LoggedOut = Template.bind({});
|
|
29
|
+
LoggedOut.args = {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import Page from './Page.svelte';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Example/Page',
|
|
5
|
+
component: Page,
|
|
6
|
+
argTypes: {
|
|
7
|
+
onLogin: { action: 'onLogin' },
|
|
8
|
+
onLogout: { action: 'onLogout' },
|
|
9
|
+
onCreateAccount: { action: 'onCreateAccount' },
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const Template = (args) => ({
|
|
14
|
+
Component: Page,
|
|
15
|
+
props: args,
|
|
16
|
+
on: {
|
|
17
|
+
login: args.onLogin,
|
|
18
|
+
logout: args.onLogout,
|
|
19
|
+
createAccount: args.onCreateAccount,
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export const LoggedIn = Template.bind({});
|
|
24
|
+
LoggedIn.args = {
|
|
25
|
+
user: {},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const LoggedOut = Template.bind({});
|
|
29
|
+
LoggedOut.args = {};
|
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": "%SET_DURING_SB_INIT%",
|
|
3
3
|
"compilerOptions": {
|
|
4
|
-
"types": [
|
|
4
|
+
"types": [
|
|
5
|
+
"node"
|
|
6
|
+
],
|
|
5
7
|
"allowSyntheticDefaultImports": true
|
|
6
8
|
},
|
|
7
|
-
"exclude": [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
"exclude": [
|
|
10
|
+
"../src/test.ts",
|
|
11
|
+
"../src/**/*.spec.ts",
|
|
12
|
+
"../projects/**/*.spec.ts"
|
|
13
|
+
],
|
|
14
|
+
"include": [
|
|
15
|
+
"../src/**/*",
|
|
16
|
+
"../projects/**/*"
|
|
17
|
+
],
|
|
18
|
+
"files": [
|
|
19
|
+
"./typings.d.ts"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": "%SET_DURING_SB_INIT%",
|
|
3
3
|
"compilerOptions": {
|
|
4
|
-
"types": [
|
|
4
|
+
"types": [
|
|
5
|
+
"node"
|
|
6
|
+
]
|
|
5
7
|
},
|
|
6
|
-
"exclude": [
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
"exclude": [
|
|
9
|
+
"../src/test.ts",
|
|
10
|
+
"../src/**/*.spec.ts",
|
|
11
|
+
"../projects/**/*.spec.ts"
|
|
12
|
+
],
|
|
13
|
+
"include": [
|
|
14
|
+
"../src/**/*",
|
|
15
|
+
"../projects/**/*"
|
|
16
|
+
],
|
|
17
|
+
"files": [
|
|
18
|
+
"./typings.d.ts"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -53,7 +53,6 @@ const generator = async (packageManager, npmOptions, options) => {
|
|
|
53
53
|
|
|
54
54
|
await (0, _baseGenerator.baseGenerator)(packageManager, npmOptions, options, 'svelte', {
|
|
55
55
|
extraPackages: ['svelte', 'svelte-loader'],
|
|
56
|
-
extraAddons: ['@storybook/addon-svelte-csf'],
|
|
57
56
|
extensions: ['js', 'jsx', 'ts', 'tsx', 'svelte'],
|
|
58
57
|
extraMain,
|
|
59
58
|
commonJs
|
|
@@ -1,59 +1,57 @@
|
|
|
1
1
|
{
|
|
2
|
-
"@storybook/addon-a11y": "6.5.0-alpha.
|
|
3
|
-
"@storybook/addon-actions": "6.5.0-alpha.
|
|
4
|
-
"@storybook/addon-backgrounds": "6.5.0-alpha.
|
|
5
|
-
"@storybook/addon-controls": "6.5.0-alpha.
|
|
6
|
-
"@storybook/addon-docs": "6.5.0-alpha.
|
|
7
|
-
"@storybook/addon-essentials": "6.5.0-alpha.
|
|
8
|
-
"@storybook/addon-interactions": "6.5.0-alpha.
|
|
9
|
-
"@storybook/addon-jest": "6.5.0-alpha.
|
|
10
|
-
"@storybook/addon-links": "6.5.0-alpha.
|
|
11
|
-
"@storybook/addon-
|
|
12
|
-
"@storybook/addon-
|
|
13
|
-
"@storybook/addon-
|
|
14
|
-
"@storybook/addon-
|
|
15
|
-
"@storybook/addon-
|
|
16
|
-
"@storybook/
|
|
17
|
-
"@storybook/
|
|
18
|
-
"@storybook/
|
|
19
|
-
"@storybook/
|
|
20
|
-
"@storybook/
|
|
21
|
-
"@storybook/builder-
|
|
22
|
-
"@storybook/
|
|
23
|
-
"@storybook/channel-
|
|
24
|
-
"@storybook/
|
|
25
|
-
"@storybook/
|
|
26
|
-
"@storybook/
|
|
27
|
-
"@storybook/client-
|
|
28
|
-
"@storybook/
|
|
29
|
-
"@storybook/
|
|
30
|
-
"@storybook/
|
|
31
|
-
"@storybook/core
|
|
32
|
-
"@storybook/core-
|
|
33
|
-
"@storybook/core-
|
|
34
|
-
"@storybook/core-
|
|
35
|
-
"@storybook/
|
|
36
|
-
"@storybook/
|
|
37
|
-
"@storybook/
|
|
38
|
-
"@storybook/
|
|
39
|
-
"@storybook/
|
|
40
|
-
"@storybook/manager-
|
|
41
|
-
"@storybook/
|
|
42
|
-
"@storybook/
|
|
43
|
-
"@storybook/
|
|
44
|
-
"@storybook/
|
|
45
|
-
"@storybook/
|
|
46
|
-
"@storybook/
|
|
47
|
-
"@storybook/
|
|
48
|
-
"@storybook/
|
|
49
|
-
"@storybook/
|
|
50
|
-
"@storybook/
|
|
51
|
-
"@storybook/
|
|
52
|
-
"@storybook/
|
|
53
|
-
"@storybook/
|
|
54
|
-
"@storybook/
|
|
55
|
-
"@storybook/
|
|
56
|
-
"@storybook/
|
|
57
|
-
"@storybook/vue3": "6.5.0-alpha.23",
|
|
58
|
-
"@storybook/web-components": "6.5.0-alpha.23"
|
|
2
|
+
"@storybook/addon-a11y": "6.5.0-alpha.24",
|
|
3
|
+
"@storybook/addon-actions": "6.5.0-alpha.24",
|
|
4
|
+
"@storybook/addon-backgrounds": "6.5.0-alpha.24",
|
|
5
|
+
"@storybook/addon-controls": "6.5.0-alpha.24",
|
|
6
|
+
"@storybook/addon-docs": "6.5.0-alpha.24",
|
|
7
|
+
"@storybook/addon-essentials": "6.5.0-alpha.24",
|
|
8
|
+
"@storybook/addon-interactions": "6.5.0-alpha.24",
|
|
9
|
+
"@storybook/addon-jest": "6.5.0-alpha.24",
|
|
10
|
+
"@storybook/addon-links": "6.5.0-alpha.24",
|
|
11
|
+
"@storybook/addon-measure": "6.5.0-alpha.24",
|
|
12
|
+
"@storybook/addon-outline": "6.5.0-alpha.24",
|
|
13
|
+
"@storybook/addon-storyshots": "6.5.0-alpha.24",
|
|
14
|
+
"@storybook/addon-storyshots-puppeteer": "6.5.0-alpha.24",
|
|
15
|
+
"@storybook/addon-storysource": "6.5.0-alpha.24",
|
|
16
|
+
"@storybook/addon-toolbars": "6.5.0-alpha.24",
|
|
17
|
+
"@storybook/addon-viewport": "6.5.0-alpha.24",
|
|
18
|
+
"@storybook/addons": "6.5.0-alpha.24",
|
|
19
|
+
"@storybook/angular": "6.5.0-alpha.24",
|
|
20
|
+
"@storybook/api": "6.5.0-alpha.24",
|
|
21
|
+
"@storybook/builder-webpack4": "6.5.0-alpha.24",
|
|
22
|
+
"@storybook/builder-webpack5": "6.5.0-alpha.24",
|
|
23
|
+
"@storybook/channel-postmessage": "6.5.0-alpha.24",
|
|
24
|
+
"@storybook/channel-websocket": "6.5.0-alpha.24",
|
|
25
|
+
"@storybook/channels": "6.5.0-alpha.24",
|
|
26
|
+
"@storybook/cli": "6.5.0-alpha.24",
|
|
27
|
+
"@storybook/client-api": "6.5.0-alpha.24",
|
|
28
|
+
"@storybook/client-logger": "6.5.0-alpha.24",
|
|
29
|
+
"@storybook/codemod": "6.5.0-alpha.24",
|
|
30
|
+
"@storybook/components": "6.5.0-alpha.24",
|
|
31
|
+
"@storybook/core": "6.5.0-alpha.24",
|
|
32
|
+
"@storybook/core-client": "6.5.0-alpha.24",
|
|
33
|
+
"@storybook/core-common": "6.5.0-alpha.24",
|
|
34
|
+
"@storybook/core-events": "6.5.0-alpha.24",
|
|
35
|
+
"@storybook/core-server": "6.5.0-alpha.24",
|
|
36
|
+
"@storybook/csf-tools": "6.5.0-alpha.24",
|
|
37
|
+
"@storybook/ember": "6.5.0-alpha.24",
|
|
38
|
+
"@storybook/html": "6.5.0-alpha.24",
|
|
39
|
+
"@storybook/instrumenter": "6.5.0-alpha.24",
|
|
40
|
+
"@storybook/manager-webpack4": "6.5.0-alpha.24",
|
|
41
|
+
"@storybook/manager-webpack5": "6.5.0-alpha.24",
|
|
42
|
+
"@storybook/node-logger": "6.5.0-alpha.24",
|
|
43
|
+
"@storybook/postinstall": "6.5.0-alpha.24",
|
|
44
|
+
"@storybook/preact": "6.5.0-alpha.24",
|
|
45
|
+
"@storybook/preview-web": "6.5.0-alpha.24",
|
|
46
|
+
"@storybook/react": "6.5.0-alpha.24",
|
|
47
|
+
"@storybook/router": "6.5.0-alpha.24",
|
|
48
|
+
"@storybook/server": "6.5.0-alpha.24",
|
|
49
|
+
"@storybook/source-loader": "6.5.0-alpha.24",
|
|
50
|
+
"@storybook/store": "6.5.0-alpha.24",
|
|
51
|
+
"@storybook/svelte": "6.5.0-alpha.24",
|
|
52
|
+
"@storybook/theming": "6.5.0-alpha.24",
|
|
53
|
+
"@storybook/ui": "6.5.0-alpha.24",
|
|
54
|
+
"@storybook/vue": "6.5.0-alpha.24",
|
|
55
|
+
"@storybook/vue3": "6.5.0-alpha.24",
|
|
56
|
+
"@storybook/web-components": "6.5.0-alpha.24"
|
|
59
57
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/cli",
|
|
3
|
-
"version": "6.5.0-alpha.
|
|
3
|
+
"version": "6.5.0-alpha.24",
|
|
4
4
|
"description": "Storybook's CLI - easiest method of adding storybook to your projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@babel/core": "^7.12.10",
|
|
50
50
|
"@babel/preset-env": "^7.12.11",
|
|
51
|
-
"@storybook/codemod": "6.5.0-alpha.
|
|
52
|
-
"@storybook/core-common": "6.5.0-alpha.
|
|
53
|
-
"@storybook/csf-tools": "6.5.0-alpha.
|
|
54
|
-
"@storybook/node-logger": "6.5.0-alpha.
|
|
51
|
+
"@storybook/codemod": "6.5.0-alpha.24",
|
|
52
|
+
"@storybook/core-common": "6.5.0-alpha.24",
|
|
53
|
+
"@storybook/csf-tools": "6.5.0-alpha.24",
|
|
54
|
+
"@storybook/node-logger": "6.5.0-alpha.24",
|
|
55
55
|
"@storybook/semver": "^7.3.2",
|
|
56
56
|
"boxen": "^5.1.2",
|
|
57
57
|
"chalk": "^4.1.0",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"update-notifier": "^5.0.1"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@storybook/client-api": "6.5.0-alpha.
|
|
79
|
+
"@storybook/client-api": "6.5.0-alpha.24",
|
|
80
80
|
"@types/cross-spawn": "^6.0.2",
|
|
81
81
|
"@types/prompts": "^2.0.9",
|
|
82
82
|
"@types/puppeteer-core": "^2.1.0",
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
"publishConfig": {
|
|
93
93
|
"access": "public"
|
|
94
94
|
},
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "9630a513a02d0faaa812d0761db396468cf8f3ca"
|
|
96
96
|
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { Meta, Template, Story } from "@storybook/addon-svelte-csf";
|
|
3
|
-
import Button from "./Button.svelte";
|
|
4
|
-
</script>
|
|
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 -->
|
|
8
|
-
<Meta
|
|
9
|
-
title="Example/Button"
|
|
10
|
-
component={Button}
|
|
11
|
-
argTypes={{
|
|
12
|
-
backgroundColor: { control: "color" },
|
|
13
|
-
label: { control: "text" },
|
|
14
|
-
onClick: { action: "onClick" },
|
|
15
|
-
primary: { control: "boolean" },
|
|
16
|
-
size: {
|
|
17
|
-
control: { type: 'select' },
|
|
18
|
-
options: ['small', 'medium', 'large'],
|
|
19
|
-
},
|
|
20
|
-
}}
|
|
21
|
-
/>
|
|
22
|
-
|
|
23
|
-
<!-- More on component templates: https://storybook.js.org/docs/svelte/writing-stories/introduction#using-args -->
|
|
24
|
-
<Template let:args>
|
|
25
|
-
<Button {...args} on:click={args.onClick} />
|
|
26
|
-
</Template>
|
|
27
|
-
|
|
28
|
-
<!-- More on args: https://storybook.js.org/docs/svelte/writing-stories/args -->
|
|
29
|
-
<Story
|
|
30
|
-
name="Primary"
|
|
31
|
-
args={{
|
|
32
|
-
primary: true,
|
|
33
|
-
label: "Button",
|
|
34
|
-
}}
|
|
35
|
-
/>
|
|
36
|
-
|
|
37
|
-
<Story
|
|
38
|
-
name="Secondary"
|
|
39
|
-
args={{
|
|
40
|
-
label: "Button",
|
|
41
|
-
}}
|
|
42
|
-
/>
|
|
43
|
-
<Story
|
|
44
|
-
name="Large"
|
|
45
|
-
args={{
|
|
46
|
-
size: "large",
|
|
47
|
-
label: "Button",
|
|
48
|
-
}}
|
|
49
|
-
/>
|
|
50
|
-
|
|
51
|
-
<Story
|
|
52
|
-
name="Small"
|
|
53
|
-
args={{
|
|
54
|
-
size: "small",
|
|
55
|
-
label: "Button",
|
|
56
|
-
}}
|
|
57
|
-
/>
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { Meta, Template, Story } from "@storybook/addon-svelte-csf";
|
|
3
|
-
import Header from "./Header.svelte";
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<Meta
|
|
7
|
-
title="Example/Header"
|
|
8
|
-
component={Header}
|
|
9
|
-
argTypes={{
|
|
10
|
-
onLogin: { action: "onLogin" },
|
|
11
|
-
onLogout: { action: "onLogout" },
|
|
12
|
-
onCreateAccount: { action: "onCreateAccount" },
|
|
13
|
-
}}
|
|
14
|
-
/>
|
|
15
|
-
|
|
16
|
-
<Template let:args>
|
|
17
|
-
<Header
|
|
18
|
-
{...args}
|
|
19
|
-
on:login={args.onLogin}
|
|
20
|
-
on:logout={args.onLogout}
|
|
21
|
-
on:createAccount={args.onCreateAccount}
|
|
22
|
-
/>
|
|
23
|
-
</Template>
|
|
24
|
-
|
|
25
|
-
<Story
|
|
26
|
-
name="LoggedIn"
|
|
27
|
-
args={{
|
|
28
|
-
user: {},
|
|
29
|
-
}}
|
|
30
|
-
/>
|
|
31
|
-
|
|
32
|
-
<Story name="LoggedOut" args={{}} />
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { Meta, Template, Story } from "@storybook/addon-svelte-csf";
|
|
3
|
-
import Page from "./Page.svelte";
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<Meta
|
|
7
|
-
title="Example/Page"
|
|
8
|
-
component={Page}
|
|
9
|
-
argTypes={{
|
|
10
|
-
onLogin: { action: "onLogin" },
|
|
11
|
-
onLogout: { action: "onLogout" },
|
|
12
|
-
onCreateAccount: { action: "onCreateAccount" },
|
|
13
|
-
}}
|
|
14
|
-
/>
|
|
15
|
-
|
|
16
|
-
<Template let:args>
|
|
17
|
-
<Page
|
|
18
|
-
{...args}
|
|
19
|
-
on:login={args.onLogin}
|
|
20
|
-
on:logout={args.onLogout}
|
|
21
|
-
on:createAccount={args.onCreateAccount}
|
|
22
|
-
/>
|
|
23
|
-
</Template>
|
|
24
|
-
|
|
25
|
-
<Story
|
|
26
|
-
name="LoggedIn"
|
|
27
|
-
args={{
|
|
28
|
-
user: {},
|
|
29
|
-
}}
|
|
30
|
-
/>
|
|
31
|
-
|
|
32
|
-
<Story name="LoggedOut" args={{}} />
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { Meta, Template, Story } from "@storybook/addon-svelte-csf";
|
|
3
|
-
import Button from "./Button.svelte";
|
|
4
|
-
</script>
|
|
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 -->
|
|
8
|
-
<Meta
|
|
9
|
-
title="Example/Button"
|
|
10
|
-
component={Button}
|
|
11
|
-
argTypes={{
|
|
12
|
-
backgroundColor: { control: "color" },
|
|
13
|
-
label: { control: "text" },
|
|
14
|
-
onClick: { action: "onClick" },
|
|
15
|
-
primary: { control: "boolean" },
|
|
16
|
-
size: {
|
|
17
|
-
control: { type: 'select' },
|
|
18
|
-
options: ['small', 'medium', 'large'],
|
|
19
|
-
},
|
|
20
|
-
}}
|
|
21
|
-
/>
|
|
22
|
-
|
|
23
|
-
<!-- More on component templates: https://storybook.js.org/docs/svelte/writing-stories/introduction#using-args -->
|
|
24
|
-
<Template let:args>
|
|
25
|
-
<Button {...args} on:click={args.onClick} />
|
|
26
|
-
</Template>
|
|
27
|
-
|
|
28
|
-
<!-- More on args: https://storybook.js.org/docs/svelte/writing-stories/args -->
|
|
29
|
-
<Story
|
|
30
|
-
name="Primary"
|
|
31
|
-
args={{
|
|
32
|
-
primary: true,
|
|
33
|
-
label: "Button",
|
|
34
|
-
}}
|
|
35
|
-
/>
|
|
36
|
-
|
|
37
|
-
<Story
|
|
38
|
-
name="Secondary"
|
|
39
|
-
args={{
|
|
40
|
-
label: "Button",
|
|
41
|
-
}}
|
|
42
|
-
/>
|
|
43
|
-
<Story
|
|
44
|
-
name="Large"
|
|
45
|
-
args={{
|
|
46
|
-
size: "large",
|
|
47
|
-
label: "Button",
|
|
48
|
-
}}
|
|
49
|
-
/>
|
|
50
|
-
|
|
51
|
-
<Story
|
|
52
|
-
name="Small"
|
|
53
|
-
args={{
|
|
54
|
-
size: "small",
|
|
55
|
-
label: "Button",
|
|
56
|
-
}}
|
|
57
|
-
/>
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { Meta, Template, Story } from "@storybook/addon-svelte-csf";
|
|
3
|
-
import Header from "./Header.svelte";
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<Meta
|
|
7
|
-
title="Example/Header"
|
|
8
|
-
component={Header}
|
|
9
|
-
argTypes={{
|
|
10
|
-
onLogin: { action: "onLogin" },
|
|
11
|
-
onLogout: { action: "onLogout" },
|
|
12
|
-
onCreateAccount: { action: "onCreateAccount" },
|
|
13
|
-
}}
|
|
14
|
-
/>
|
|
15
|
-
|
|
16
|
-
<Template let:args>
|
|
17
|
-
<Header
|
|
18
|
-
{...args}
|
|
19
|
-
on:login={args.onLogin}
|
|
20
|
-
on:logout={args.onLogout}
|
|
21
|
-
on:createAccount={args.onCreateAccount}
|
|
22
|
-
/>
|
|
23
|
-
</Template>
|
|
24
|
-
|
|
25
|
-
<Story
|
|
26
|
-
name="LoggedIn"
|
|
27
|
-
args={{
|
|
28
|
-
user: {},
|
|
29
|
-
}}
|
|
30
|
-
/>
|
|
31
|
-
|
|
32
|
-
<Story name="LoggedOut" args={{}} />
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { Meta, Template, Story } from "@storybook/addon-svelte-csf";
|
|
3
|
-
import Page from "./Page.svelte";
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<Meta
|
|
7
|
-
title="Example/Page"
|
|
8
|
-
component={Page}
|
|
9
|
-
argTypes={{
|
|
10
|
-
onLogin: { action: "onLogin" },
|
|
11
|
-
onLogout: { action: "onLogout" },
|
|
12
|
-
onCreateAccount: { action: "onCreateAccount" },
|
|
13
|
-
}}
|
|
14
|
-
/>
|
|
15
|
-
|
|
16
|
-
<Template let:args>
|
|
17
|
-
<Page
|
|
18
|
-
{...args}
|
|
19
|
-
on:login={args.onLogin}
|
|
20
|
-
on:logout={args.onLogout}
|
|
21
|
-
on:createAccount={args.onCreateAccount}
|
|
22
|
-
/>
|
|
23
|
-
</Template>
|
|
24
|
-
|
|
25
|
-
<Story
|
|
26
|
-
name="LoggedIn"
|
|
27
|
-
args={{
|
|
28
|
-
user: {},
|
|
29
|
-
}}
|
|
30
|
-
/>
|
|
31
|
-
|
|
32
|
-
<Story name="LoggedOut" args={{}} />
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { Meta, Template, Story } from "@storybook/addon-svelte-csf";
|
|
3
|
-
import Button from "./Button.svelte";
|
|
4
|
-
</script>
|
|
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 -->
|
|
8
|
-
<Meta
|
|
9
|
-
title="Example/Button"
|
|
10
|
-
component={Button}
|
|
11
|
-
argTypes={{
|
|
12
|
-
backgroundColor: { control: "color" },
|
|
13
|
-
label: { control: "text" },
|
|
14
|
-
onClick: { action: "onClick" },
|
|
15
|
-
primary: { control: "boolean" },
|
|
16
|
-
size: {
|
|
17
|
-
control: { type: 'select' },
|
|
18
|
-
options: ['small', 'medium', 'large'],
|
|
19
|
-
},
|
|
20
|
-
}}
|
|
21
|
-
/>
|
|
22
|
-
|
|
23
|
-
<!-- More on component templates: https://storybook.js.org/docs/svelte/writing-stories/introduction#using-args -->
|
|
24
|
-
<Template let:args>
|
|
25
|
-
<Button {...args} on:click={args.onClick} />
|
|
26
|
-
</Template>
|
|
27
|
-
|
|
28
|
-
<!-- More on args: https://storybook.js.org/docs/svelte/writing-stories/args -->
|
|
29
|
-
<Story
|
|
30
|
-
name="Primary"
|
|
31
|
-
args={{
|
|
32
|
-
primary: true,
|
|
33
|
-
label: "Button",
|
|
34
|
-
}}
|
|
35
|
-
/>
|
|
36
|
-
|
|
37
|
-
<Story
|
|
38
|
-
name="Secondary"
|
|
39
|
-
args={{
|
|
40
|
-
label: "Button",
|
|
41
|
-
}}
|
|
42
|
-
/>
|
|
43
|
-
<Story
|
|
44
|
-
name="Large"
|
|
45
|
-
args={{
|
|
46
|
-
size: "large",
|
|
47
|
-
label: "Button",
|
|
48
|
-
}}
|
|
49
|
-
/>
|
|
50
|
-
|
|
51
|
-
<Story
|
|
52
|
-
name="Small"
|
|
53
|
-
args={{
|
|
54
|
-
size: "small",
|
|
55
|
-
label: "Button",
|
|
56
|
-
}}
|
|
57
|
-
/>
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { Meta, Template, Story } from "@storybook/addon-svelte-csf";
|
|
3
|
-
import Header from "./Header.svelte";
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<Meta
|
|
7
|
-
title="Example/Header"
|
|
8
|
-
component={Header}
|
|
9
|
-
argTypes={{
|
|
10
|
-
onLogin: { action: "onLogin" },
|
|
11
|
-
onLogout: { action: "onLogout" },
|
|
12
|
-
onCreateAccount: { action: "onCreateAccount" },
|
|
13
|
-
}}
|
|
14
|
-
/>
|
|
15
|
-
|
|
16
|
-
<Template let:args>
|
|
17
|
-
<Header
|
|
18
|
-
{...args}
|
|
19
|
-
on:login={args.onLogin}
|
|
20
|
-
on:logout={args.onLogout}
|
|
21
|
-
on:createAccount={args.onCreateAccount}
|
|
22
|
-
/>
|
|
23
|
-
</Template>
|
|
24
|
-
|
|
25
|
-
<Story
|
|
26
|
-
name="LoggedIn"
|
|
27
|
-
args={{
|
|
28
|
-
user: {},
|
|
29
|
-
}}
|
|
30
|
-
/>
|
|
31
|
-
|
|
32
|
-
<Story name="LoggedOut" args={{}} />
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { Meta, Template, Story } from "@storybook/addon-svelte-csf";
|
|
3
|
-
import Page from "./Page.svelte";
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<Meta
|
|
7
|
-
title="Example/Page"
|
|
8
|
-
component={Page}
|
|
9
|
-
argTypes={{
|
|
10
|
-
onLogin: { action: "onLogin" },
|
|
11
|
-
onLogout: { action: "onLogout" },
|
|
12
|
-
onCreateAccount: { action: "onCreateAccount" },
|
|
13
|
-
}}
|
|
14
|
-
/>
|
|
15
|
-
|
|
16
|
-
<Template let:args>
|
|
17
|
-
<Page
|
|
18
|
-
{...args}
|
|
19
|
-
on:login={args.onLogin}
|
|
20
|
-
on:logout={args.onLogout}
|
|
21
|
-
on:createAccount={args.onCreateAccount}
|
|
22
|
-
/>
|
|
23
|
-
</Template>
|
|
24
|
-
|
|
25
|
-
<Story
|
|
26
|
-
name="LoggedIn"
|
|
27
|
-
args={{
|
|
28
|
-
user: {},
|
|
29
|
-
}}
|
|
30
|
-
/>
|
|
31
|
-
|
|
32
|
-
<Story name="LoggedOut" args={{}} />
|