@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.
Files changed (36) hide show
  1. package/README.md +29 -33
  2. package/__tests__/render.test.ts +1 -1
  3. package/apps/hello-world/.storybook/main.ts +32 -12
  4. package/apps/hello-world/package-lock.json +7448 -0
  5. package/apps/hello-world/package.json +10 -10
  6. package/apps/hello-world/src/stories/hello-world.stories.ts +11 -10
  7. package/apps/hello-world-webpack/.storybook/main.ts +1 -4
  8. package/apps/hello-world-webpack/package-lock.json +380 -3515
  9. package/apps/hello-world-webpack/package.json +9 -10
  10. package/apps/hello-world-webpack/src/hello-world.html +6 -0
  11. package/apps/hello-world-webpack/src/hello-world.ts +17 -0
  12. package/apps/hello-world-webpack/src/my-app.stories.ts +10 -7
  13. package/apps/hello-world-webpack/src/stories/hello-world.stories.ts +54 -0
  14. package/dist/index.js +65 -38
  15. package/dist/index.js.map +1 -1
  16. package/dist/index.mjs +62 -39
  17. package/dist/index.mjs.map +1 -1
  18. package/dist/preset.js +15 -1
  19. package/dist/preset.js.map +1 -1
  20. package/dist/preset.mjs +15 -1
  21. package/dist/preset.mjs.map +1 -1
  22. package/dist/preview/render.js +41 -40
  23. package/dist/preview/render.js.map +1 -1
  24. package/dist/preview/render.mjs +41 -40
  25. package/dist/preview/render.mjs.map +1 -1
  26. package/dist/preview.js +81 -39
  27. package/dist/preview.js.map +1 -1
  28. package/dist/preview.mjs +81 -40
  29. package/dist/preview.mjs.map +1 -1
  30. package/package.json +6 -10
  31. package/rollup.config.mjs +6 -4
  32. package/src/index.ts +28 -0
  33. package/src/preset.ts +19 -1
  34. package/src/preview/render.ts +51 -49
  35. package/src/preview/types.ts +1 -1
  36. 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.1.1",
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": "^8.5.3",
21
- "@storybook/addon-essentials": "^8.5.3",
22
- "@storybook/addon-interactions": "^8.5.3",
23
- "@storybook/addon-links": "^8.5.3",
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 { action } from '@storybook/addon-actions';
3
- import { userEvent, within } from '@storybook/testing-library';
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: (args) => ({
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 from Storybook!",
22
- onIncrement: action('increment')
21
+ message: "Hello frof",
22
+ onIncrement: fn()
23
23
  }
24
24
  };
25
25
 
26
26
  export const InteractiveHelloWorld = {
27
27
  args: {
28
- message: "Try clicking the button!",
29
- onIncrement: action('increment')
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: (args) => ({
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 message"
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-webpack5-compiler-swc",
6
- "@storybook/addon-links",
7
- "@storybook/addon-essentials"
4
+ "@storybook/addon-links"
8
5
  ],
9
6
  framework: {
10
7
  name: '@aurelia/storybook',