@storybook/angular 10.5.0-beta.2 → 10.5.1
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/_node-chunks/{angular-cli-webpack-LKCDU6YU.js → angular-cli-webpack-A4FJB333.js} +6 -6
- package/dist/_node-chunks/{chunk-6L7UUV7N.js → chunk-N5YUH4RD.js} +7 -7
- package/dist/_node-chunks/{chunk-CEK3UDOQ.js → chunk-ZO6LERUI.js} +6 -6
- package/dist/builders/build-storybook/index.js +8 -8
- package/dist/builders/start-storybook/index.js +8 -8
- package/dist/node/index.js +6 -6
- package/dist/preset.js +6 -6
- package/dist/server/framework-preset-angular-cli.js +8 -8
- package/dist/server/framework-preset-angular-ivy.js +6 -6
- package/package.json +4 -4
- package/template/cli/button.component.ts +10 -8
- package/template/cli/header.component.ts +52 -50
- package/template/cli/page.component.ts +57 -55
package/dist/_node-chunks/{angular-cli-webpack-LKCDU6YU.js → angular-cli-webpack-A4FJB333.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_hoe4l9cryml from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_hoe4l9cryml from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_hoe4l9cryml from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_hoe4l9cryml.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_hoe4l9cryml.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_hoe4l9cryml.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_hoe4l9cryml from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_hoe4l9cryml from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_hoe4l9cryml from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_hoe4l9cryml.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_hoe4l9cryml.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_hoe4l9cryml.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
up
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ZO6LERUI.js";
|
|
15
15
|
|
|
16
16
|
// ../../../node_modules/empathic/package.mjs
|
|
17
17
|
function up2(options) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_hoe4l9cryml from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_hoe4l9cryml from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_hoe4l9cryml from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_hoe4l9cryml.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_hoe4l9cryml.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_hoe4l9cryml.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_hoe4l9cryml from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_hoe4l9cryml from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_hoe4l9cryml from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_hoe4l9cryml.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_hoe4l9cryml.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_hoe4l9cryml.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
printErrorDetails,
|
|
15
15
|
runCompodoc,
|
|
16
16
|
up as up2
|
|
17
|
-
} from "../../_node-chunks/chunk-
|
|
17
|
+
} from "../../_node-chunks/chunk-N5YUH4RD.js";
|
|
18
18
|
import {
|
|
19
19
|
up
|
|
20
|
-
} from "../../_node-chunks/chunk-
|
|
20
|
+
} from "../../_node-chunks/chunk-ZO6LERUI.js";
|
|
21
21
|
|
|
22
22
|
// src/builders/build-storybook/index.ts
|
|
23
23
|
import { readFileSync } from "node:fs";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_hoe4l9cryml from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_hoe4l9cryml from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_hoe4l9cryml from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_hoe4l9cryml.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_hoe4l9cryml.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_hoe4l9cryml.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
printErrorDetails,
|
|
15
15
|
runCompodoc,
|
|
16
16
|
up as up2
|
|
17
|
-
} from "../../_node-chunks/chunk-
|
|
17
|
+
} from "../../_node-chunks/chunk-N5YUH4RD.js";
|
|
18
18
|
import {
|
|
19
19
|
up
|
|
20
|
-
} from "../../_node-chunks/chunk-
|
|
20
|
+
} from "../../_node-chunks/chunk-ZO6LERUI.js";
|
|
21
21
|
|
|
22
22
|
// src/builders/start-storybook/index.ts
|
|
23
23
|
import { readFileSync } from "node:fs";
|
package/dist/node/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_hoe4l9cryml from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_hoe4l9cryml from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_hoe4l9cryml from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_hoe4l9cryml.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_hoe4l9cryml.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_hoe4l9cryml.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
package/dist/preset.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_hoe4l9cryml from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_hoe4l9cryml from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_hoe4l9cryml from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_hoe4l9cryml.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_hoe4l9cryml.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_hoe4l9cryml.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_hoe4l9cryml from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_hoe4l9cryml from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_hoe4l9cryml from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_hoe4l9cryml.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_hoe4l9cryml.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_hoe4l9cryml.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
up
|
|
14
|
-
} from "../_node-chunks/chunk-
|
|
14
|
+
} from "../_node-chunks/chunk-ZO6LERUI.js";
|
|
15
15
|
|
|
16
16
|
// src/server/framework-preset-angular-cli.ts
|
|
17
17
|
import { logger } from "storybook/internal/node-logger";
|
|
@@ -89,7 +89,7 @@ var relative = function(from, to) {
|
|
|
89
89
|
async function webpackFinal(baseConfig, options) {
|
|
90
90
|
if (!resolvePackageDir("@angular-devkit/build-angular"))
|
|
91
91
|
return logger.info('Using base config because "@angular-devkit/build-angular" is not installed'), baseConfig;
|
|
92
|
-
let { WebpackDefinePlugin, WebpackIgnorePlugin } = await import("@storybook/builder-webpack5"), { getWebpackConfig: getCustomWebpackConfig } = await import("../_node-chunks/angular-cli-webpack-
|
|
92
|
+
let { WebpackDefinePlugin, WebpackIgnorePlugin } = await import("@storybook/builder-webpack5"), { getWebpackConfig: getCustomWebpackConfig } = await import("../_node-chunks/angular-cli-webpack-A4FJB333.js");
|
|
93
93
|
checkForLegacyBuildOptions(options);
|
|
94
94
|
let builderContext = getBuilderContext(options), builderOptions = await getBuilderOptions(options, builderContext), webpackConfig = await getCustomWebpackConfig(baseConfig, {
|
|
95
95
|
builderOptions: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_hoe4l9cryml from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_hoe4l9cryml from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_hoe4l9cryml from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_hoe4l9cryml.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_hoe4l9cryml.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_hoe4l9cryml.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/angular",
|
|
3
|
-
"version": "10.5.
|
|
3
|
+
"version": "10.5.1",
|
|
4
4
|
"description": "Storybook for Angular: Develop, document, and test UI components in isolation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"!src/**/*"
|
|
60
60
|
],
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@storybook/builder-webpack5": "10.5.
|
|
62
|
+
"@storybook/builder-webpack5": "10.5.1",
|
|
63
63
|
"@storybook/global": "^5.0.0",
|
|
64
64
|
"telejson": "8.0.0",
|
|
65
65
|
"ts-dedent": "^2.0.0",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"@angular/forms": "^19.1.1",
|
|
80
80
|
"@angular/platform-browser": "^19.1.1",
|
|
81
81
|
"@angular/platform-browser-dynamic": "^19.1.1",
|
|
82
|
-
"@storybook/core-webpack": "10.5.
|
|
82
|
+
"@storybook/core-webpack": "10.5.1",
|
|
83
83
|
"@types/node": "^22.19.1",
|
|
84
84
|
"empathic": "^2.0.0",
|
|
85
85
|
"rimraf": "^6.0.1",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"@angular/platform-browser": ">=18.0.0 < 23.0.0",
|
|
101
101
|
"@angular/platform-browser-dynamic": ">=18.0.0 < 23.0.0",
|
|
102
102
|
"rxjs": "^6.5.3 || ^7.4.0",
|
|
103
|
-
"storybook": "^10.5.
|
|
103
|
+
"storybook": "^10.5.1",
|
|
104
104
|
"typescript": "^4.9.0 || ^5.0.0",
|
|
105
105
|
"zone.js": ">=0.14.0"
|
|
106
106
|
},
|
|
@@ -5,14 +5,16 @@ import { Component, Input, Output, EventEmitter } from '@angular/core';
|
|
|
5
5
|
selector: 'storybook-button',
|
|
6
6
|
standalone: true,
|
|
7
7
|
imports: [CommonModule],
|
|
8
|
-
template: `
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
template: `
|
|
9
|
+
<button
|
|
10
|
+
type="button"
|
|
11
|
+
(click)="onClick.emit($event)"
|
|
12
|
+
[ngClass]="classes"
|
|
13
|
+
[ngStyle]="{ 'background-color': backgroundColor }"
|
|
14
|
+
>
|
|
15
|
+
{{ label }}
|
|
16
|
+
</button>
|
|
17
|
+
`,
|
|
16
18
|
styleUrls: ['./button.css'],
|
|
17
19
|
})
|
|
18
20
|
export class ButtonComponent {
|
|
@@ -8,57 +8,59 @@ import type { User } from './user';
|
|
|
8
8
|
selector: 'storybook-header',
|
|
9
9
|
standalone: true,
|
|
10
10
|
imports: [CommonModule, ButtonComponent],
|
|
11
|
-
template:
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
11
|
+
template: `
|
|
12
|
+
<header>
|
|
13
|
+
<div class="storybook-header">
|
|
14
|
+
<div>
|
|
15
|
+
<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
|
16
|
+
<g fill="none" fillRule="evenodd">
|
|
17
|
+
<path
|
|
18
|
+
d="M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z"
|
|
19
|
+
fill="#FFF"
|
|
20
|
+
/>
|
|
21
|
+
<path
|
|
22
|
+
d="M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z"
|
|
23
|
+
fill="#555AB9"
|
|
24
|
+
/>
|
|
25
|
+
<path d="M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z" fill="#91BAF8" />
|
|
26
|
+
</g>
|
|
27
|
+
</svg>
|
|
28
|
+
<h1>Acme</h1>
|
|
29
|
+
</div>
|
|
30
|
+
<div>
|
|
31
|
+
<div *ngIf="user">
|
|
32
|
+
<span class="welcome">
|
|
33
|
+
Welcome, <b>{{ user.name }}</b
|
|
34
|
+
>!
|
|
35
|
+
</span>
|
|
36
|
+
<storybook-button
|
|
37
|
+
*ngIf="user"
|
|
38
|
+
size="small"
|
|
39
|
+
(onClick)="onLogout.emit($event)"
|
|
40
|
+
label="Log out"
|
|
41
|
+
></storybook-button>
|
|
42
|
+
</div>
|
|
43
|
+
<div *ngIf="!user">
|
|
44
|
+
<storybook-button
|
|
45
|
+
*ngIf="!user"
|
|
46
|
+
size="small"
|
|
47
|
+
class="margin-left"
|
|
48
|
+
(onClick)="onLogin.emit($event)"
|
|
49
|
+
label="Log in"
|
|
50
|
+
></storybook-button>
|
|
51
|
+
<storybook-button
|
|
52
|
+
*ngIf="!user"
|
|
53
|
+
size="small"
|
|
54
|
+
[primary]="true"
|
|
55
|
+
class="margin-left"
|
|
56
|
+
(onClick)="onCreateAccount.emit($event)"
|
|
57
|
+
label="Sign up"
|
|
58
|
+
></storybook-button>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
41
61
|
</div>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
*ngIf="!user"
|
|
45
|
-
size="small"
|
|
46
|
-
class="margin-left"
|
|
47
|
-
(onClick)="onLogin.emit($event)"
|
|
48
|
-
label="Log in"
|
|
49
|
-
></storybook-button>
|
|
50
|
-
<storybook-button
|
|
51
|
-
*ngIf="!user"
|
|
52
|
-
size="small"
|
|
53
|
-
[primary]="true"
|
|
54
|
-
class="margin-left"
|
|
55
|
-
(onClick)="onCreateAccount.emit($event)"
|
|
56
|
-
label="Sign up"
|
|
57
|
-
></storybook-button>
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
</header>`,
|
|
62
|
+
</header>
|
|
63
|
+
`,
|
|
62
64
|
styleUrls: ['./header.css'],
|
|
63
65
|
})
|
|
64
66
|
export class HeaderComponent {
|
|
@@ -8,61 +8,63 @@ import type { User } from './user';
|
|
|
8
8
|
selector: 'storybook-page',
|
|
9
9
|
standalone: true,
|
|
10
10
|
imports: [CommonModule, HeaderComponent],
|
|
11
|
-
template:
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
</
|
|
11
|
+
template: `
|
|
12
|
+
<article>
|
|
13
|
+
<storybook-header
|
|
14
|
+
[user]="user"
|
|
15
|
+
(onLogout)="doLogout()"
|
|
16
|
+
(onLogin)="doLogin()"
|
|
17
|
+
(onCreateAccount)="doCreateAccount()"
|
|
18
|
+
></storybook-header>
|
|
19
|
+
<section class="storybook-page">
|
|
20
|
+
<h2>Pages in Storybook</h2>
|
|
21
|
+
<p>
|
|
22
|
+
We recommend building UIs with a
|
|
23
|
+
<a href="https://componentdriven.org" target="_blank" rel="noopener noreferrer">
|
|
24
|
+
<strong>component-driven</strong>
|
|
25
|
+
</a>
|
|
26
|
+
process starting with atomic components and ending with pages.
|
|
27
|
+
</p>
|
|
28
|
+
<p>
|
|
29
|
+
Render pages with mock data. This makes it easy to build and review page states without
|
|
30
|
+
needing to navigate to them in your app. Here are some handy patterns for managing page data
|
|
31
|
+
in Storybook:
|
|
32
|
+
</p>
|
|
33
|
+
<ul>
|
|
34
|
+
<li>
|
|
35
|
+
Use a higher-level connected component. Storybook helps you compose such data from the
|
|
36
|
+
"args" of child component stories
|
|
37
|
+
</li>
|
|
38
|
+
<li>
|
|
39
|
+
Assemble data in the page component from your services. You can mock these services out
|
|
40
|
+
using Storybook.
|
|
41
|
+
</li>
|
|
42
|
+
</ul>
|
|
43
|
+
<p>
|
|
44
|
+
Get a guided tutorial on component-driven development at
|
|
45
|
+
<a href="https://storybook.js.org/tutorials/" target="_blank" rel="noopener noreferrer">
|
|
46
|
+
Storybook tutorials
|
|
47
|
+
</a>
|
|
48
|
+
. Read more in the
|
|
49
|
+
<a href="https://storybook.js.org/docs" target="_blank" rel="noopener noreferrer"> docs </a>
|
|
50
|
+
.
|
|
51
|
+
</p>
|
|
52
|
+
<div class="tip-wrapper">
|
|
53
|
+
<span class="tip">Tip</span> Adjust the width of the canvas with the
|
|
54
|
+
<svg width="10" height="10" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg">
|
|
55
|
+
<g fill="none" fillRule="evenodd">
|
|
56
|
+
<path
|
|
57
|
+
d="M1.5 5.2h4.8c.3 0 .5.2.5.4v5.1c-.1.2-.3.3-.4.3H1.4a.5.5 0 01-.5-.4V5.7c0-.3.2-.5.5-.5zm0-2.1h6.9c.3 0 .5.2.5.4v7a.5.5 0 01-1 0V4H1.5a.5.5 0 010-1zm0-2.1h9c.3 0 .5.2.5.4v9.1a.5.5 0 01-1 0V2H1.5a.5.5 0 010-1zm4.3 5.2H2V10h3.8V6.2z"
|
|
58
|
+
id="a"
|
|
59
|
+
fill="#999"
|
|
60
|
+
/>
|
|
61
|
+
</g>
|
|
62
|
+
</svg>
|
|
63
|
+
Viewports addon in the toolbar
|
|
64
|
+
</div>
|
|
65
|
+
</section>
|
|
66
|
+
</article>
|
|
67
|
+
`,
|
|
66
68
|
styleUrls: ['./page.css'],
|
|
67
69
|
})
|
|
68
70
|
export class PageComponent {
|