@storybook/web-components-vite 11.0.0-beta.0 → 11.0.0-beta.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/index.js +6 -6
- package/dist/preset.js +6 -6
- package/package.json +4 -4
- package/template/cli/js/Button.stories.js +11 -10
- package/template/cli/js/Header.stories.js +8 -5
- package/template/cli/js/Page.stories.js +9 -8
- package/template/cli/ts/Button.stories.ts +11 -14
- package/template/cli/ts/Header.stories.ts +8 -9
- package/template/cli/ts/Page.stories.ts +9 -12
package/dist/node/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_tf9odrfqqcn from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_tf9odrfqqcn from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_tf9odrfqqcn from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_tf9odrfqqcn.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_tf9odrfqqcn.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_tf9odrfqqcn.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_tf9odrfqqcn from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_tf9odrfqqcn from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_tf9odrfqqcn from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_tf9odrfqqcn.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_tf9odrfqqcn.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_tf9odrfqqcn.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/web-components-vite",
|
|
3
|
-
"version": "11.0.0-beta.
|
|
3
|
+
"version": "11.0.0-beta.1",
|
|
4
4
|
"description": "Storybook for Web Components and Vite: Develop, document, and test UI components in isolation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -50,15 +50,15 @@
|
|
|
50
50
|
"!src/**/*"
|
|
51
51
|
],
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@storybook/builder-vite": "11.0.0-beta.
|
|
54
|
-
"@storybook/web-components": "11.0.0-beta.
|
|
53
|
+
"@storybook/builder-vite": "11.0.0-beta.1",
|
|
54
|
+
"@storybook/web-components": "11.0.0-beta.1"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@types/node": "^22.19.1",
|
|
58
58
|
"typescript": "^6.0.3"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"storybook": "^11.0.0-beta.
|
|
61
|
+
"storybook": "^11.0.0-beta.1",
|
|
62
62
|
"typescript": "^5.9.0 || ^6.0.0 || ^7.0.0",
|
|
63
63
|
"vite": "^6.3.0 || ^7.0.0 || ^8.0.0"
|
|
64
64
|
},
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import preview from '../../.storybook/preview';
|
|
1
2
|
import { fn } from 'storybook/test';
|
|
2
3
|
|
|
3
4
|
import { Button } from './Button';
|
|
4
5
|
|
|
5
6
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
6
|
-
|
|
7
|
+
const meta = preview.meta({
|
|
7
8
|
title: 'Example/Button',
|
|
8
9
|
tags: ['autodocs'],
|
|
9
10
|
render: (args) => Button(args),
|
|
@@ -15,32 +16,32 @@ export default {
|
|
|
15
16
|
},
|
|
16
17
|
},
|
|
17
18
|
args: { onClick: fn() },
|
|
18
|
-
};
|
|
19
|
+
});
|
|
19
20
|
|
|
20
21
|
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
21
|
-
export const Primary = {
|
|
22
|
+
export const Primary = meta.story({
|
|
22
23
|
args: {
|
|
23
24
|
primary: true,
|
|
24
25
|
label: 'Button',
|
|
25
26
|
},
|
|
26
|
-
};
|
|
27
|
+
});
|
|
27
28
|
|
|
28
|
-
export const Secondary = {
|
|
29
|
+
export const Secondary = meta.story({
|
|
29
30
|
args: {
|
|
30
31
|
label: 'Button',
|
|
31
32
|
},
|
|
32
|
-
};
|
|
33
|
+
});
|
|
33
34
|
|
|
34
|
-
export const Large = {
|
|
35
|
+
export const Large = meta.story({
|
|
35
36
|
args: {
|
|
36
37
|
size: 'large',
|
|
37
38
|
label: 'Button',
|
|
38
39
|
},
|
|
39
|
-
};
|
|
40
|
+
});
|
|
40
41
|
|
|
41
|
-
export const Small = {
|
|
42
|
+
export const Small = meta.story({
|
|
42
43
|
args: {
|
|
43
44
|
size: 'small',
|
|
44
45
|
label: 'Button',
|
|
45
46
|
},
|
|
46
|
-
};
|
|
47
|
+
});
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import preview from '../../.storybook/preview';
|
|
1
2
|
import { fn } from 'storybook/test';
|
|
2
3
|
|
|
3
4
|
import { Header } from './Header';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
const meta = preview.meta({
|
|
6
7
|
title: 'Example/Header',
|
|
7
8
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/web-components/vue/writing-docs/autodocs
|
|
8
9
|
tags: ['autodocs'],
|
|
@@ -12,13 +13,15 @@ export default {
|
|
|
12
13
|
onLogout: fn(),
|
|
13
14
|
onCreateAccount: fn(),
|
|
14
15
|
},
|
|
15
|
-
};
|
|
16
|
-
export const LoggedIn = {
|
|
16
|
+
});
|
|
17
|
+
export const LoggedIn = meta.story({
|
|
17
18
|
args: {
|
|
18
19
|
user: {
|
|
19
20
|
name: 'Jane Doe',
|
|
20
21
|
},
|
|
21
22
|
},
|
|
22
|
-
};
|
|
23
|
+
});
|
|
23
24
|
|
|
24
|
-
export const LoggedOut = {
|
|
25
|
+
export const LoggedOut = meta.story({
|
|
26
|
+
args: {},
|
|
27
|
+
});
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
+
import preview from '../../.storybook/preview';
|
|
1
2
|
import * as HeaderStories from './Header.stories';
|
|
2
3
|
import { Page } from './Page';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
const meta = preview.meta({
|
|
5
6
|
title: 'Example/Page',
|
|
6
7
|
render: (args) => Page(args),
|
|
7
|
-
};
|
|
8
|
+
});
|
|
8
9
|
|
|
9
|
-
export const LoggedIn = {
|
|
10
|
+
export const LoggedIn = meta.story({
|
|
10
11
|
args: {
|
|
11
12
|
// More on composing args: https://storybook.js.org/docs/writing-stories/args#args-composition
|
|
12
|
-
...HeaderStories.LoggedIn.args,
|
|
13
|
+
...HeaderStories.LoggedIn.input.args,
|
|
13
14
|
},
|
|
14
|
-
};
|
|
15
|
+
});
|
|
15
16
|
|
|
16
|
-
export const LoggedOut = {
|
|
17
|
+
export const LoggedOut = meta.story({
|
|
17
18
|
args: {
|
|
18
|
-
...HeaderStories.LoggedOut.args,
|
|
19
|
+
...HeaderStories.LoggedOut.input.args,
|
|
19
20
|
},
|
|
20
|
-
};
|
|
21
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import preview from '../../.storybook/preview';
|
|
2
2
|
|
|
3
3
|
import { fn } from 'storybook/test';
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ import type { ButtonProps } from './Button';
|
|
|
6
6
|
import { Button } from './Button';
|
|
7
7
|
|
|
8
8
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
9
|
-
const meta = {
|
|
9
|
+
const meta = preview.type<{ args: ButtonProps }>().meta({
|
|
10
10
|
title: 'Example/Button',
|
|
11
11
|
tags: ['autodocs'],
|
|
12
12
|
render: (args) => Button(args),
|
|
@@ -18,35 +18,32 @@ const meta = {
|
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
20
|
args: { onClick: fn() },
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export default meta;
|
|
24
|
-
type Story = StoryObj<ButtonProps>;
|
|
21
|
+
});
|
|
25
22
|
|
|
26
23
|
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
27
|
-
export const Primary
|
|
24
|
+
export const Primary = meta.story({
|
|
28
25
|
args: {
|
|
29
26
|
primary: true,
|
|
30
27
|
label: 'Button',
|
|
31
28
|
},
|
|
32
|
-
};
|
|
29
|
+
});
|
|
33
30
|
|
|
34
|
-
export const Secondary
|
|
31
|
+
export const Secondary = meta.story({
|
|
35
32
|
args: {
|
|
36
33
|
label: 'Button',
|
|
37
34
|
},
|
|
38
|
-
};
|
|
35
|
+
});
|
|
39
36
|
|
|
40
|
-
export const Large
|
|
37
|
+
export const Large = meta.story({
|
|
41
38
|
args: {
|
|
42
39
|
size: 'large',
|
|
43
40
|
label: 'Button',
|
|
44
41
|
},
|
|
45
|
-
};
|
|
42
|
+
});
|
|
46
43
|
|
|
47
|
-
export const Small
|
|
44
|
+
export const Small = meta.story({
|
|
48
45
|
args: {
|
|
49
46
|
size: 'small',
|
|
50
47
|
label: 'Button',
|
|
51
48
|
},
|
|
52
|
-
};
|
|
49
|
+
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import preview from '../../.storybook/preview';
|
|
2
2
|
|
|
3
3
|
import { fn } from 'storybook/test';
|
|
4
4
|
|
|
5
5
|
import type { HeaderProps } from './Header';
|
|
6
6
|
import { Header } from './Header';
|
|
7
7
|
|
|
8
|
-
const meta = {
|
|
8
|
+
const meta = preview.type<{ args: HeaderProps }>().meta({
|
|
9
9
|
title: 'Example/Header',
|
|
10
10
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
11
11
|
tags: ['autodocs'],
|
|
@@ -15,17 +15,16 @@ const meta = {
|
|
|
15
15
|
onLogout: fn(),
|
|
16
16
|
onCreateAccount: fn(),
|
|
17
17
|
},
|
|
18
|
-
}
|
|
18
|
+
});
|
|
19
19
|
|
|
20
|
-
export
|
|
21
|
-
type Story = StoryObj<HeaderProps>;
|
|
22
|
-
|
|
23
|
-
export const LoggedIn: Story = {
|
|
20
|
+
export const LoggedIn = meta.story({
|
|
24
21
|
args: {
|
|
25
22
|
user: {
|
|
26
23
|
name: 'Jane Doe',
|
|
27
24
|
},
|
|
28
25
|
},
|
|
29
|
-
};
|
|
26
|
+
});
|
|
30
27
|
|
|
31
|
-
export const LoggedOut
|
|
28
|
+
export const LoggedOut = meta.story({
|
|
29
|
+
args: {},
|
|
30
|
+
});
|
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
import
|
|
1
|
+
import preview from '../../.storybook/preview';
|
|
2
2
|
|
|
3
3
|
import * as HeaderStories from './Header.stories';
|
|
4
4
|
import type { PageProps } from './Page';
|
|
5
5
|
import { Page } from './Page';
|
|
6
6
|
|
|
7
|
-
const meta = {
|
|
7
|
+
const meta = preview.type<{ args: PageProps }>().meta({
|
|
8
8
|
title: 'Example/Page',
|
|
9
9
|
render: (args: PageProps) => Page(args),
|
|
10
|
-
}
|
|
10
|
+
});
|
|
11
11
|
|
|
12
|
-
export
|
|
13
|
-
type Story = StoryObj<PageProps>;
|
|
14
|
-
|
|
15
|
-
export const LoggedIn: Story = {
|
|
12
|
+
export const LoggedIn = meta.story({
|
|
16
13
|
args: {
|
|
17
14
|
// More on composing args: https://storybook.js.org/docs/writing-stories/args#args-composition
|
|
18
|
-
...HeaderStories.LoggedIn.args,
|
|
15
|
+
...HeaderStories.LoggedIn.input.args,
|
|
19
16
|
},
|
|
20
|
-
};
|
|
17
|
+
});
|
|
21
18
|
|
|
22
|
-
export const LoggedOut
|
|
19
|
+
export const LoggedOut = meta.story({
|
|
23
20
|
args: {
|
|
24
|
-
...HeaderStories.LoggedOut.args,
|
|
21
|
+
...HeaderStories.LoggedOut.input.args,
|
|
25
22
|
},
|
|
26
|
-
};
|
|
23
|
+
});
|