@aurelia/storybook 1.0.0 → 1.0.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/README.md +29 -33
- package/__tests__/render.test.ts +1 -1
- package/apps/hello-world/.storybook/main.ts +32 -12
- package/apps/hello-world/package-lock.json +7448 -0
- package/apps/hello-world/package.json +10 -10
- package/apps/hello-world/src/stories/hello-world.stories.ts +11 -10
- package/apps/hello-world-webpack/.storybook/main.ts +1 -4
- package/apps/hello-world-webpack/package-lock.json +380 -3515
- package/apps/hello-world-webpack/package.json +9 -10
- package/apps/hello-world-webpack/src/hello-world.html +6 -0
- package/apps/hello-world-webpack/src/hello-world.ts +17 -0
- package/apps/hello-world-webpack/src/my-app.stories.ts +10 -7
- package/apps/hello-world-webpack/src/stories/hello-world.stories.ts +54 -0
- package/dist/index.js +65 -38
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +62 -39
- package/dist/index.mjs.map +1 -1
- package/dist/preset.js +15 -1
- package/dist/preset.js.map +1 -1
- package/dist/preset.mjs +15 -1
- package/dist/preset.mjs.map +1 -1
- package/dist/preview/render.js +41 -40
- package/dist/preview/render.js.map +1 -1
- package/dist/preview/render.mjs +41 -40
- package/dist/preview/render.mjs.map +1 -1
- package/dist/preview.js +81 -39
- package/dist/preview.js.map +1 -1
- package/dist/preview.mjs +81 -40
- package/dist/preview.mjs.map +1 -1
- package/package.json +6 -10
- package/rollup.config.mjs +6 -4
- package/src/index.ts +28 -0
- package/src/preset.ts +19 -1
- package/src/preview/render.ts +51 -49
- package/src/preview/types.ts +1 -1
- package/src/preview.ts +1 -50
|
@@ -14,25 +14,25 @@
|
|
|
14
14
|
"aurelia": "^2.0.0-beta.24"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@aurelia/storybook": "^0.
|
|
17
|
+
"@aurelia/storybook": "^1.0.2",
|
|
18
18
|
"@aurelia/testing": "^2.0.0-beta.24",
|
|
19
19
|
"@aurelia/vite-plugin": "^2.0.0-beta.24",
|
|
20
|
-
"@storybook/addon-actions": "^
|
|
21
|
-
"@storybook/addon-
|
|
22
|
-
"@storybook/
|
|
23
|
-
"@storybook/
|
|
24
|
-
"@storybook/builder-vite": "^8.5.3",
|
|
25
|
-
"@storybook/core-common": "^8.5.3",
|
|
26
|
-
"@storybook/preview-api": "^8.5.3",
|
|
27
|
-
"@storybook/testing-library": "^0.2.1",
|
|
28
|
-
"@storybook/types": "^8.5.3",
|
|
20
|
+
"@storybook/addon-actions": "^9.0.0",
|
|
21
|
+
"@storybook/addon-links": "^9.0.0",
|
|
22
|
+
"@storybook/builder-vite": "^9.0.0",
|
|
23
|
+
"@storybook/test": "^9.0.0-alpha.2",
|
|
29
24
|
"@tailwindcss/vite": "^4.0.0",
|
|
30
25
|
"@types/node": "^22.10.2",
|
|
26
|
+
"@types/react": "^19.1.8",
|
|
27
|
+
"@types/react-dom": "^19.1.6",
|
|
31
28
|
"eslint": "^9.17.0",
|
|
32
29
|
"globals": "^15.14.0",
|
|
33
30
|
"jsdom": "^25.0.1",
|
|
34
31
|
"node-html-parser": "^7.0.1",
|
|
32
|
+
"react": "^19.1.0",
|
|
33
|
+
"react-dom": "^19.1.0",
|
|
35
34
|
"sass": "^1.83.4",
|
|
35
|
+
"storybook": "^9.0.0",
|
|
36
36
|
"stylelint": "^16.12.0",
|
|
37
37
|
"stylelint-config-standard": "^36.0.1",
|
|
38
38
|
"stylus": "^0.64.0",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { HelloWorld } from '../hello-world';
|
|
2
|
-
import {
|
|
3
|
-
import { userEvent, within } from '@storybook/
|
|
2
|
+
import { fn } from '@storybook/test';
|
|
3
|
+
import { userEvent, within } from '@storybook/test';
|
|
4
4
|
|
|
5
5
|
const meta = {
|
|
6
6
|
title: 'Example/HelloWorld',
|
|
7
7
|
component: HelloWorld,
|
|
8
|
-
render: (
|
|
8
|
+
render: () => ({
|
|
9
9
|
template: `<hello-world message.bind="message" on-increment.bind="onIncrement"></hello-world>`,
|
|
10
10
|
}),
|
|
11
11
|
argTypes: {
|
|
@@ -18,19 +18,20 @@ export default meta;
|
|
|
18
18
|
|
|
19
19
|
export const DefaultHelloWorld = {
|
|
20
20
|
args: {
|
|
21
|
-
message: "Hello
|
|
22
|
-
onIncrement:
|
|
21
|
+
message: "Hello frof",
|
|
22
|
+
onIncrement: fn()
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
export const InteractiveHelloWorld = {
|
|
27
27
|
args: {
|
|
28
|
-
message: "
|
|
29
|
-
onIncrement:
|
|
28
|
+
message: "fsdfdddsdsdsdsdddddfdddd",
|
|
29
|
+
onIncrement: fn()
|
|
30
30
|
},
|
|
31
|
-
play: async ({ canvasElement }) => {
|
|
31
|
+
play: async ({ canvasElement }: { canvasElement: HTMLElement }) => {
|
|
32
32
|
const canvas = within(canvasElement);
|
|
33
33
|
const button = canvas.getByRole('button');
|
|
34
|
+
// Simulate three button clicks
|
|
34
35
|
await userEvent.click(button);
|
|
35
36
|
await userEvent.click(button);
|
|
36
37
|
await userEvent.click(button);
|
|
@@ -44,10 +45,10 @@ export const NoArgs = {
|
|
|
44
45
|
};
|
|
45
46
|
|
|
46
47
|
export const WithCustomTemplate = {
|
|
47
|
-
render: (
|
|
48
|
+
render: () => ({
|
|
48
49
|
template: `<hello-world message.bind="message">Click me!</hello-world>`
|
|
49
50
|
}),
|
|
50
51
|
args: {
|
|
51
|
-
message: "This is a custom
|
|
52
|
+
message: "This is a custom messageddd"
|
|
52
53
|
}
|
|
53
54
|
};
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
/** @type { import('@storybook/core-common').StorybookConfig } */
|
|
2
1
|
const config = {
|
|
3
2
|
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
|
|
4
3
|
addons: [
|
|
5
|
-
"@storybook/addon-
|
|
6
|
-
"@storybook/addon-links",
|
|
7
|
-
"@storybook/addon-essentials"
|
|
4
|
+
"@storybook/addon-links"
|
|
8
5
|
],
|
|
9
6
|
framework: {
|
|
10
7
|
name: '@aurelia/storybook',
|