@storybook/angular 11.0.0-beta.0 → 11.0.0-beta.2
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/_browser-chunks/{chunk-M5CWHAJJ.js → chunk-GHAVXUL3.js} +3 -3
- package/dist/_browser-chunks/{chunk-OU5A7FPZ.js → chunk-IG5LI7GN.js} +1 -1
- package/dist/_browser-chunks/{chunk-ZATG2N4T.js → chunk-J3KWA7RA.js} +6 -1
- package/dist/_browser-chunks/{chunk-A7CCO6TU.js → chunk-MXCWHRQJ.js} +1 -1
- package/dist/_node-chunks/{angular-cli-webpack-3G3MBO5F.js → angular-cli-webpack-LKSQAEX2.js} +6 -6
- package/dist/_node-chunks/{chunk-U2BTFASY.js → chunk-7XVO2L2W.js} +9 -9
- package/dist/_node-chunks/{chunk-5D7K3AFA.js → chunk-H5UZHPEP.js} +6 -6
- package/dist/builders/build-storybook/index.js +8 -8
- package/dist/builders/start-storybook/index.js +8 -8
- package/dist/client/config.js +2 -2
- package/dist/client/docs/config.js +2 -2
- package/dist/client/index.js +4 -4
- package/dist/index.js +4 -4
- 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 +5 -5
- package/start-schema.json +1 -1
- package/template/cli/button.stories.ts +11 -14
- package/template/cli/header.stories.ts +6 -9
- package/template/cli/page.stories.ts +6 -9
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
config_exports
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MXCWHRQJ.js";
|
|
4
4
|
import {
|
|
5
5
|
config_exports as config_exports2
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-IG5LI7GN.js";
|
|
7
7
|
import {
|
|
8
8
|
computesTemplateFromComponent,
|
|
9
9
|
formatPropInTemplate,
|
|
10
10
|
isComponent,
|
|
11
11
|
render_exports
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-J3KWA7RA.js";
|
|
13
13
|
|
|
14
14
|
// src/client/portable-stories.ts
|
|
15
15
|
import {
|
|
@@ -531,7 +531,12 @@ var applicationRefs = /* @__PURE__ */ new Map(), STORY_UID_ATTRIBUTE = "data-sb-
|
|
|
531
531
|
/** Wait and destroy the platform */
|
|
532
532
|
static resetApplications(domNode) {
|
|
533
533
|
applicationRefs.forEach((appRef, appDOMNode) => {
|
|
534
|
-
!appRef.destroyed && (!domNode || appDOMNode === domNode)
|
|
534
|
+
if (!appRef.destroyed && (!domNode || appDOMNode === domNode))
|
|
535
|
+
try {
|
|
536
|
+
appRef.components.slice().forEach((componentRef) => componentRef.destroy());
|
|
537
|
+
} finally {
|
|
538
|
+
appRef.destroy();
|
|
539
|
+
}
|
|
535
540
|
});
|
|
536
541
|
}
|
|
537
542
|
/**
|
package/dist/_node-chunks/{angular-cli-webpack-3G3MBO5F.js → angular-cli-webpack-LKSQAEX2.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_dc5vymsqpcj from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_dc5vymsqpcj from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_dc5vymsqpcj from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_dc5vymsqpcj.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_dc5vymsqpcj.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_dc5vymsqpcj.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_dc5vymsqpcj from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_dc5vymsqpcj from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_dc5vymsqpcj from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_dc5vymsqpcj.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_dc5vymsqpcj.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_dc5vymsqpcj.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-H5UZHPEP.js";
|
|
15
15
|
|
|
16
16
|
// ../../../node_modules/empathic/package.mjs
|
|
17
17
|
function up2(options) {
|
|
@@ -19,10 +19,10 @@ function up2(options) {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
// src/builders/utils/error-handler.ts
|
|
22
|
-
import { logger
|
|
22
|
+
import { logger } from "storybook/internal/node-logger";
|
|
23
23
|
import { dedent } from "ts-dedent";
|
|
24
24
|
var printErrorDetails = (error) => {
|
|
25
|
-
|
|
25
|
+
error instanceof Error ? error.error ? logger.error(error.error) : error.stats && error.stats.compilation.errors ? error.stats.compilation.errors.forEach((e) => logger.log(e)) : logger.error(error) : error.compilation?.errors && error.compilation.errors.forEach((e) => logger.log(e));
|
|
26
26
|
}, errorSummary = (error) => error.close ? dedent`
|
|
27
27
|
FATAL broken build!, will close the process,
|
|
28
28
|
Fix the error below and restart storybook.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_dc5vymsqpcj from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_dc5vymsqpcj from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_dc5vymsqpcj from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_dc5vymsqpcj.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_dc5vymsqpcj.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_dc5vymsqpcj.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_dc5vymsqpcj from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_dc5vymsqpcj from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_dc5vymsqpcj from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_dc5vymsqpcj.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_dc5vymsqpcj.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_dc5vymsqpcj.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-7XVO2L2W.js";
|
|
18
18
|
import {
|
|
19
19
|
up
|
|
20
|
-
} from "../../_node-chunks/chunk-
|
|
20
|
+
} from "../../_node-chunks/chunk-H5UZHPEP.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_dc5vymsqpcj from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_dc5vymsqpcj from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_dc5vymsqpcj from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_dc5vymsqpcj.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_dc5vymsqpcj.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_dc5vymsqpcj.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-7XVO2L2W.js";
|
|
18
18
|
import {
|
|
19
19
|
up
|
|
20
|
-
} from "../../_node-chunks/chunk-
|
|
20
|
+
} from "../../_node-chunks/chunk-H5UZHPEP.js";
|
|
21
21
|
|
|
22
22
|
// src/builders/start-storybook/index.ts
|
|
23
23
|
import { readFileSync } from "node:fs";
|
package/dist/client/config.js
CHANGED
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
argTypesEnhancers,
|
|
3
3
|
decorateStory,
|
|
4
4
|
parameters
|
|
5
|
-
} from "../_browser-chunks/chunk-
|
|
5
|
+
} from "../_browser-chunks/chunk-MXCWHRQJ.js";
|
|
6
6
|
import {
|
|
7
7
|
render,
|
|
8
8
|
renderToCanvas
|
|
9
|
-
} from "../_browser-chunks/chunk-
|
|
9
|
+
} from "../_browser-chunks/chunk-J3KWA7RA.js";
|
|
10
10
|
export {
|
|
11
11
|
decorateStory as applyDecorators,
|
|
12
12
|
argTypesEnhancers,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
decorators,
|
|
3
3
|
parameters
|
|
4
|
-
} from "../../_browser-chunks/chunk-
|
|
5
|
-
import "../../_browser-chunks/chunk-
|
|
4
|
+
} from "../../_browser-chunks/chunk-IG5LI7GN.js";
|
|
5
|
+
import "../../_browser-chunks/chunk-J3KWA7RA.js";
|
|
6
6
|
export {
|
|
7
7
|
decorators,
|
|
8
8
|
parameters
|
package/dist/client/index.js
CHANGED
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
componentWrapperDecorator,
|
|
6
6
|
moduleMetadata,
|
|
7
7
|
setProjectAnnotations
|
|
8
|
-
} from "../_browser-chunks/chunk-
|
|
9
|
-
import "../_browser-chunks/chunk-
|
|
10
|
-
import "../_browser-chunks/chunk-
|
|
11
|
-
import "../_browser-chunks/chunk-
|
|
8
|
+
} from "../_browser-chunks/chunk-GHAVXUL3.js";
|
|
9
|
+
import "../_browser-chunks/chunk-MXCWHRQJ.js";
|
|
10
|
+
import "../_browser-chunks/chunk-IG5LI7GN.js";
|
|
11
|
+
import "../_browser-chunks/chunk-J3KWA7RA.js";
|
|
12
12
|
export {
|
|
13
13
|
__definePreview,
|
|
14
14
|
applicationConfig,
|
package/dist/index.js
CHANGED
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
componentWrapperDecorator,
|
|
6
6
|
moduleMetadata,
|
|
7
7
|
setProjectAnnotations
|
|
8
|
-
} from "./_browser-chunks/chunk-
|
|
9
|
-
import "./_browser-chunks/chunk-
|
|
10
|
-
import "./_browser-chunks/chunk-
|
|
11
|
-
import "./_browser-chunks/chunk-
|
|
8
|
+
} from "./_browser-chunks/chunk-GHAVXUL3.js";
|
|
9
|
+
import "./_browser-chunks/chunk-MXCWHRQJ.js";
|
|
10
|
+
import "./_browser-chunks/chunk-IG5LI7GN.js";
|
|
11
|
+
import "./_browser-chunks/chunk-J3KWA7RA.js";
|
|
12
12
|
export {
|
|
13
13
|
__definePreview,
|
|
14
14
|
applicationConfig,
|
package/dist/node/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_dc5vymsqpcj from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_dc5vymsqpcj from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_dc5vymsqpcj from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_dc5vymsqpcj.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_dc5vymsqpcj.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_dc5vymsqpcj.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_dc5vymsqpcj from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_dc5vymsqpcj from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_dc5vymsqpcj from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_dc5vymsqpcj.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_dc5vymsqpcj.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_dc5vymsqpcj.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_dc5vymsqpcj from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_dc5vymsqpcj from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_dc5vymsqpcj from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_dc5vymsqpcj.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_dc5vymsqpcj.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_dc5vymsqpcj.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-H5UZHPEP.js";
|
|
15
15
|
|
|
16
16
|
// src/server/framework-preset-angular-cli.ts
|
|
17
17
|
import { logger } from "storybook/internal/node-logger";
|
|
@@ -314,7 +314,7 @@ var delimiter = globalThis.process?.platform === "win32" ? ";" : ":", _platforms
|
|
|
314
314
|
async function webpackFinal(baseConfig, options) {
|
|
315
315
|
if (!resolvePackageDir("@angular-devkit/build-angular"))
|
|
316
316
|
return logger.info('Using base config because "@angular-devkit/build-angular" is not installed'), baseConfig;
|
|
317
|
-
let { WebpackDefinePlugin, WebpackIgnorePlugin } = await import("@storybook/builder-webpack5"), { getWebpackConfig: getCustomWebpackConfig } = await import("../_node-chunks/angular-cli-webpack-
|
|
317
|
+
let { WebpackDefinePlugin, WebpackIgnorePlugin } = await import("@storybook/builder-webpack5"), { getWebpackConfig: getCustomWebpackConfig } = await import("../_node-chunks/angular-cli-webpack-LKSQAEX2.js");
|
|
318
318
|
checkForLegacyBuildOptions(options);
|
|
319
319
|
let builderContext = getBuilderContext(options), builderOptions = await getBuilderOptions(options, builderContext), webpackConfig = await getCustomWebpackConfig(baseConfig, {
|
|
320
320
|
builderOptions: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_dc5vymsqpcj from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_dc5vymsqpcj from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_dc5vymsqpcj from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_dc5vymsqpcj.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_dc5vymsqpcj.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_dc5vymsqpcj.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": "11.0.0-beta.
|
|
3
|
+
"version": "11.0.0-beta.2",
|
|
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": "11.0.0-beta.
|
|
62
|
+
"@storybook/builder-webpack5": "11.0.0-beta.2",
|
|
63
63
|
"@storybook/global": "^5.0.0",
|
|
64
64
|
"telejson": "8.0.0",
|
|
65
65
|
"ts-dedent": "^2.2.0",
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
"@angular/forms": "^21.0.0",
|
|
80
80
|
"@angular/platform-browser": "^21.0.0",
|
|
81
81
|
"@angular/platform-browser-dynamic": "^21.0.0",
|
|
82
|
-
"@storybook/angular-compodoc": "11.0.0-beta.
|
|
83
|
-
"@storybook/core-webpack": "11.0.0-beta.
|
|
82
|
+
"@storybook/angular-compodoc": "11.0.0-beta.2",
|
|
83
|
+
"@storybook/core-webpack": "11.0.0-beta.2",
|
|
84
84
|
"@types/node": "^22.19.1",
|
|
85
85
|
"empathic": "^2.0.0",
|
|
86
86
|
"rimraf": "^6.0.1",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"@angular/platform-browser": ">=21.0.0 < 23.0.0",
|
|
102
102
|
"@angular/platform-browser-dynamic": ">=21.0.0 < 23.0.0",
|
|
103
103
|
"rxjs": "^6.5.3 || ^7.4.0",
|
|
104
|
-
"storybook": "^11.0.0-beta.
|
|
104
|
+
"storybook": "^11.0.0-beta.2",
|
|
105
105
|
"typescript": "^5.9.0 || ^6.0.0 || ^7.0.0",
|
|
106
106
|
"zone.js": ">=0.14.0"
|
|
107
107
|
},
|
package/start-schema.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import preview from '../../.storybook/preview';
|
|
2
2
|
import { fn } from 'storybook/test';
|
|
3
3
|
|
|
4
4
|
import { ButtonComponent } from './button.component';
|
|
5
5
|
|
|
6
6
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
|
-
const meta
|
|
7
|
+
const meta = preview.meta({
|
|
8
8
|
title: 'Example/Button',
|
|
9
9
|
component: ButtonComponent,
|
|
10
10
|
tags: ['autodocs'],
|
|
@@ -15,35 +15,32 @@ const meta: Meta<ButtonComponent> = {
|
|
|
15
15
|
},
|
|
16
16
|
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#story-args
|
|
17
17
|
args: { onClick: fn() },
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export default meta;
|
|
21
|
-
type Story = StoryObj<ButtonComponent>;
|
|
18
|
+
});
|
|
22
19
|
|
|
23
20
|
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
24
|
-
export const Primary
|
|
21
|
+
export const Primary = meta.story({
|
|
25
22
|
args: {
|
|
26
23
|
primary: true,
|
|
27
24
|
label: 'Button',
|
|
28
25
|
},
|
|
29
|
-
};
|
|
26
|
+
});
|
|
30
27
|
|
|
31
|
-
export const Secondary
|
|
28
|
+
export const Secondary = meta.story({
|
|
32
29
|
args: {
|
|
33
30
|
label: 'Button',
|
|
34
31
|
},
|
|
35
|
-
};
|
|
32
|
+
});
|
|
36
33
|
|
|
37
|
-
export const Large
|
|
34
|
+
export const Large = meta.story({
|
|
38
35
|
args: {
|
|
39
36
|
size: 'large',
|
|
40
37
|
label: 'Button',
|
|
41
38
|
},
|
|
42
|
-
};
|
|
39
|
+
});
|
|
43
40
|
|
|
44
|
-
export const Small
|
|
41
|
+
export const Small = meta.story({
|
|
45
42
|
args: {
|
|
46
43
|
size: 'small',
|
|
47
44
|
label: 'Button',
|
|
48
45
|
},
|
|
49
|
-
};
|
|
46
|
+
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import preview from '../../.storybook/preview';
|
|
2
2
|
import { fn } from 'storybook/test';
|
|
3
3
|
|
|
4
4
|
import { HeaderComponent } from './header.component';
|
|
5
5
|
|
|
6
|
-
const meta
|
|
6
|
+
const meta = preview.meta({
|
|
7
7
|
title: 'Example/Header',
|
|
8
8
|
component: HeaderComponent,
|
|
9
9
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
@@ -17,17 +17,14 @@ const meta: Meta<HeaderComponent> = {
|
|
|
17
17
|
onLogout: fn(),
|
|
18
18
|
onCreateAccount: fn(),
|
|
19
19
|
},
|
|
20
|
-
};
|
|
20
|
+
});
|
|
21
21
|
|
|
22
|
-
export
|
|
23
|
-
type Story = StoryObj<HeaderComponent>;
|
|
24
|
-
|
|
25
|
-
export const LoggedIn: Story = {
|
|
22
|
+
export const LoggedIn = meta.story({
|
|
26
23
|
args: {
|
|
27
24
|
user: {
|
|
28
25
|
name: 'Jane Doe',
|
|
29
26
|
},
|
|
30
27
|
},
|
|
31
|
-
};
|
|
28
|
+
});
|
|
32
29
|
|
|
33
|
-
export const LoggedOut
|
|
30
|
+
export const LoggedOut = meta.story();
|
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import preview from '../../.storybook/preview';
|
|
2
2
|
import { expect, userEvent, within } from 'storybook/test';
|
|
3
3
|
|
|
4
4
|
import { PageComponent } from './page.component';
|
|
5
5
|
|
|
6
|
-
const meta
|
|
6
|
+
const meta = preview.meta({
|
|
7
7
|
title: 'Example/Page',
|
|
8
8
|
component: PageComponent,
|
|
9
9
|
parameters: {
|
|
10
10
|
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
|
|
11
11
|
layout: 'fullscreen',
|
|
12
12
|
},
|
|
13
|
-
};
|
|
13
|
+
});
|
|
14
14
|
|
|
15
|
-
export
|
|
16
|
-
type Story = StoryObj<PageComponent>;
|
|
17
|
-
|
|
18
|
-
export const LoggedOut: Story = {};
|
|
15
|
+
export const LoggedOut = meta.story();
|
|
19
16
|
|
|
20
17
|
// More on component testing: https://storybook.js.org/docs/writing-tests/interaction-testing
|
|
21
|
-
export const LoggedIn
|
|
18
|
+
export const LoggedIn = meta.story({
|
|
22
19
|
play: async ({ canvasElement }) => {
|
|
23
20
|
const canvas = within(canvasElement);
|
|
24
21
|
const loginButton = canvas.getByRole('button', { name: /Log in/i });
|
|
@@ -29,4 +26,4 @@ export const LoggedIn: Story = {
|
|
|
29
26
|
const logoutButton = canvas.getByRole('button', { name: /Log out/i });
|
|
30
27
|
await expect(logoutButton).toBeInTheDocument();
|
|
31
28
|
},
|
|
32
|
-
};
|
|
29
|
+
});
|